Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
a8295577
Unverified
Commit
a8295577
authored
Sep 22, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CS: PSR1/2
parent
b4d1ad30
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
135 additions
and
73 deletions
+135
-73
ConfigureDatabase.php
...les/Core/Console/Installers/Scripts/ConfigureDatabase.php
+2
-3
CreateEnvFile.php
Modules/Core/Console/Installers/Scripts/CreateEnvFile.php
+0
-6
SetInstalledFlag.php
Modules/Core/Console/Installers/Scripts/SetInstalledFlag.php
+1
-3
EnvFileWriter.php
Modules/Core/Console/Installers/Writers/EnvFileWriter.php
+1
-8
Translatable.php
Modules/Core/Doctrine/Translatable.php
+4
-2
BaseFormRequest.php
Modules/Core/Internationalisation/BaseFormRequest.php
+4
-1
CoreServiceProvider.php
Modules/Core/Providers/CoreServiceProvider.php
+3
-1
BaseCacheDecorator.php
Modules/Core/Repositories/Cache/BaseCacheDecorator.php
+27
-9
CacheWidgetDecorator.php
...les/Dashboard/Repositories/Cache/CacheWidgetDecorator.php
+6
-2
2017_09_20_144631_add_folders_columns_on_files_table.php
.../2017_09_20_144631_add_folders_columns_on_files_table.php
+2
-2
Imagy.php
Modules/Media/Image/Imagy.php
+3
-3
EloquentFolderRepositoryTest.php
Modules/Media/Tests/EloquentFolderRepositoryTest.php
+2
-2
MediaTransformer.php
Modules/Media/Transformers/MediaTransformer.php
+2
-2
CacheMenuDecorator.php
Modules/Menu/Repositories/Cache/CacheMenuDecorator.php
+3
-1
CacheMenuItemDecorator.php
Modules/Menu/Repositories/Cache/CacheMenuItemDecorator.php
+18
-6
CachePageDecorator.php
Modules/Page/Repositories/Cache/CachePageDecorator.php
+12
-4
SettingController.php
Modules/Setting/Http/Controllers/Admin/SettingController.php
+4
-2
CacheSettingDecorator.php
Modules/Setting/Repositories/Cache/CacheSettingDecorator.php
+21
-7
CacheTagDecorator.php
Modules/Tag/Repositories/Cache/CacheTagDecorator.php
+3
-1
CacheTranslationDecorator.php
...nslation/Repositories/Cache/CacheTranslationDecorator.php
+8
-4
CacheUserTokenDecorator.php
Modules/User/Repositories/Cache/CacheUserTokenDecorator.php
+3
-1
ModulesController.php
...les/Workshop/Http/Controllers/Admin/ModulesController.php
+4
-2
backendRoutes.php
Modules/Workshop/Http/backendRoutes.php
+2
-1
No files found.
Modules/Core/Console/Installers/Scripts/ConfigureDatabase.php
View file @
a8295577
...
...
@@ -51,7 +51,6 @@ class ConfigureDatabase implements SetupScript
$vars
=
[];
while
(
!
$connected
)
{
$vars
[
'db_driver'
]
=
$this
->
askDatabaseDriver
();
$vars
[
'db_host'
]
=
$this
->
askDatabaseHost
();
$vars
[
'db_port'
]
=
$this
->
askDatabasePort
(
$vars
[
'db_driver'
]);
...
...
@@ -158,7 +157,7 @@ class ConfigureDatabase implements SetupScript
$this
->
config
[
'database.connections.'
.
$driver
.
'.database'
]
=
$vars
[
'db_database'
];
$this
->
config
[
'database.connections.'
.
$driver
.
'.username'
]
=
$vars
[
'db_username'
];
$this
->
config
[
'database.connections.'
.
$driver
.
'.password'
]
=
$vars
[
'db_password'
];
app
(
DatabaseManager
::
class
)
->
purge
(
$driver
);
app
(
ConnectionFactory
::
class
)
->
make
(
$this
->
config
[
'database.connections.'
.
$driver
],
$driver
);
}
...
...
@@ -177,4 +176,4 @@ class ConfigureDatabase implements SetupScript
return
false
;
}
}
}
\ No newline at end of file
}
Modules/Core/Console/Installers/Scripts/CreateEnvFile.php
View file @
a8295577
...
...
@@ -6,10 +6,8 @@ use Illuminate\Console\Command;
use
Modules\Core\Console\Installers\SetupScript
;
use
Modules\Core\Console\Installers\Writers\EnvFileWriter
;
class
CreateEnvFile
implements
SetupScript
{
/**
* @var EnvFileWriter
*/
...
...
@@ -42,8 +40,4 @@ class CreateEnvFile implements SetupScript
$command
->
info
(
'Successfully created .env file'
);
}
}
Modules/Core/Console/Installers/Scripts/SetInstalledFlag.php
View file @
a8295577
...
...
@@ -25,7 +25,6 @@ class SetInstalledFlag implements SetupScript
*/
public
function
fire
(
Command
$command
)
{
$vars
=
[];
$vars
[
'installed'
]
=
'true'
;
...
...
@@ -33,6 +32,5 @@ class SetInstalledFlag implements SetupScript
$this
->
env
->
write
(
$vars
);
$command
->
info
(
'The application is now installed'
);
}
}
\ No newline at end of file
}
Modules/Core/Console/Installers/Writers/EnvFileWriter.php
View file @
a8295577
...
...
@@ -68,26 +68,19 @@ class EnvFileWriter
public
function
write
(
$vars
)
{
if
(
!
empty
(
$vars
))
{
$environmentFile
=
$this
->
finder
->
get
(
$this
->
file
);
foreach
(
$vars
as
$key
=>
$value
)
{
if
(
isset
(
$this
->
setable_variables
[
$key
]))
{
$env_var_name
=
explode
(
'='
,
$this
->
setable_variables
[
$key
])[
0
];
$value
=
$env_var_name
.
'='
.
$value
;
$environmentFile
=
str_replace
(
$this
->
setable_variables
[
$key
],
$value
,
$environmentFile
);
}
}
$this
->
finder
->
put
(
$this
->
file
,
$environmentFile
);
}
}
}
\ No newline at end of file
}
Modules/Core/Doctrine/Translatable.php
View file @
a8295577
...
...
@@ -98,8 +98,10 @@ trait Translatable
$cacheArray
=
[];
$translatedEntityName
=
$this
->
getTranslationClass
();
if
(
!
isset
(
$cacheArray
[
$translatedEntityName
]))
{
$cacheArray
[
$translatedEntityName
]
=
array_values
(
array_diff
(
EntityManagerFacade
::
getClassMetadata
(
$translatedEntityName
)
->
getColumnNames
(),
[
'id'
,
'locale'
]));
$cacheArray
[
$translatedEntityName
]
=
array_values
(
array_diff
(
EntityManagerFacade
::
getClassMetadata
(
$translatedEntityName
)
->
getColumnNames
(),
[
'id'
,
'locale'
]
));
}
return
$cacheArray
[
$translatedEntityName
];
...
...
Modules/Core/Internationalisation/BaseFormRequest.php
View file @
a8295577
...
...
@@ -67,7 +67,10 @@ abstract class BaseFormRequest extends FormRequest
}
return
$factory
->
make
(
$this
->
all
(),
$rules
,
array_merge
(
$this
->
messages
(),
$messages
),
$attributes
$this
->
all
(),
$rules
,
array_merge
(
$this
->
messages
(),
$messages
),
$attributes
);
}
...
...
Modules/Core/Providers/CoreServiceProvider.php
View file @
a8295577
...
...
@@ -262,7 +262,9 @@ class CoreServiceProvider extends ServiceProvider
$localeConfig
=
$this
->
app
[
'cache'
]
->
tags
(
'setting.settings'
,
'global'
)
->
remember
(
"asgard.locales"
,
120
,
->
remember
(
"asgard.locales"
,
120
,
function
()
{
return
DB
::
table
(
'setting__settings'
)
->
whereName
(
'core::locales'
)
->
first
();
}
...
...
Modules/Core/Repositories/Cache/BaseCacheDecorator.php
View file @
a8295577
...
...
@@ -45,7 +45,9 @@ abstract class BaseCacheDecorator implements BaseRepository
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.find.
{
$id
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.find.
{
$id
}
"
,
$this
->
cacheTime
,
function
()
use
(
$id
)
{
return
$this
->
repository
->
find
(
$id
);
}
...
...
@@ -59,7 +61,9 @@ abstract class BaseCacheDecorator implements BaseRepository
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.all"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.all"
,
$this
->
cacheTime
,
function
()
{
return
$this
->
repository
->
all
();
}
...
...
@@ -73,7 +77,9 @@ abstract class BaseCacheDecorator implements BaseRepository
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allWithBuilder"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allWithBuilder"
,
$this
->
cacheTime
,
function
()
{
return
$this
->
repository
->
allWithBuilder
();
}
...
...
@@ -87,7 +93,9 @@ abstract class BaseCacheDecorator implements BaseRepository
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.paginate.
{
$perPage
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.paginate.
{
$perPage
}
"
,
$this
->
cacheTime
,
function
()
use
(
$perPage
)
{
return
$this
->
repository
->
paginate
(
$perPage
);
}
...
...
@@ -101,7 +109,9 @@ abstract class BaseCacheDecorator implements BaseRepository
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allTranslatedIn.
{
$lang
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allTranslatedIn.
{
$lang
}
"
,
$this
->
cacheTime
,
function
()
use
(
$lang
)
{
return
$this
->
repository
->
allTranslatedIn
(
$lang
);
}
...
...
@@ -115,7 +125,9 @@ abstract class BaseCacheDecorator implements BaseRepository
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findBySlug.
{
$slug
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findBySlug.
{
$slug
}
"
,
$this
->
cacheTime
,
function
()
use
(
$slug
)
{
return
$this
->
repository
->
findBySlug
(
$slug
);
}
...
...
@@ -161,7 +173,9 @@ abstract class BaseCacheDecorator implements BaseRepository
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findByAttributes.
{
$tagIdentifier
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findByAttributes.
{
$tagIdentifier
}
"
,
$this
->
cacheTime
,
function
()
use
(
$attributes
)
{
return
$this
->
repository
->
findByAttributes
(
$attributes
);
}
...
...
@@ -177,7 +191,9 @@ abstract class BaseCacheDecorator implements BaseRepository
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findByAttributes.
{
$tagIdentifier
}
.
{
$orderBy
}
.
{
$sortOrder
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findByAttributes.
{
$tagIdentifier
}
.
{
$orderBy
}
.
{
$sortOrder
}
"
,
$this
->
cacheTime
,
function
()
use
(
$attributes
,
$orderBy
,
$sortOrder
)
{
return
$this
->
repository
->
getByAttributes
(
$attributes
,
$orderBy
,
$sortOrder
);
}
...
...
@@ -193,7 +209,9 @@ abstract class BaseCacheDecorator implements BaseRepository
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findByMany.
{
$tagIdentifier
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findByMany.
{
$tagIdentifier
}
"
,
$this
->
cacheTime
,
function
()
use
(
$ids
)
{
return
$this
->
repository
->
findByMany
(
$ids
);
}
...
...
Modules/Dashboard/Repositories/Cache/CacheWidgetDecorator.php
View file @
a8295577
...
...
@@ -23,7 +23,9 @@ class CacheWidgetDecorator extends BaseCacheDecorator implements WidgetRepositor
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findForUser.
{
$userId
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findForUser.
{
$userId
}
"
,
$this
->
cacheTime
,
function
()
use
(
$userId
)
{
return
$this
->
repository
->
findForUser
(
$userId
);
}
...
...
@@ -40,7 +42,9 @@ class CacheWidgetDecorator extends BaseCacheDecorator implements WidgetRepositor
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.updateOrCreateForUser.
{
$userId
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.updateOrCreateForUser.
{
$userId
}
"
,
$this
->
cacheTime
,
function
()
use
(
$widgets
,
$userId
)
{
return
$this
->
repository
->
updateOrCreateForUser
(
$widgets
,
$userId
);
}
...
...
Modules/Media/Database/Migrations/2017_09_20_144631_add_folders_columns_on_files_table.php
View file @
a8295577
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
AddFoldersColumnsOnFilesTable
extends
Migration
{
...
...
Modules/Media/Image/Imagy.php
View file @
a8295577
...
...
@@ -257,13 +257,13 @@ class Imagy
}
$filenameWithoutPrefix
=
$this
->
removeConfigPrefix
(
$path
->
getRelativeUrl
());
$filename
=
substr
(
strrchr
(
$filenameWithoutPrefix
,
'/'
),
1
);
$folders
=
str_replace
(
$filename
,
''
,
$filenameWithoutPrefix
);
$folders
=
str_replace
(
$filename
,
''
,
$filenameWithoutPrefix
);
if
(
$filename
===
false
)
{
return
config
(
'asgard.media.config.files-path'
)
.
$this
->
newFilename
(
$path
,
$thumbnail
);
}
return
config
(
'asgard.media.config.files-path'
)
.
$folders
.
$this
->
newFilename
(
$path
,
$thumbnail
);
return
config
(
'asgard.media.config.files-path'
)
.
$folders
.
$this
->
newFilename
(
$path
,
$thumbnail
);
}
/**
...
...
@@ -276,7 +276,7 @@ class Imagy
return
str_replace
([
$configAssetPath
,
ltrim
(
$configAssetPath
,
'/'
)
ltrim
(
$configAssetPath
,
'/'
)
,
],
''
,
$path
);
}
}
Modules/Media/Tests/EloquentFolderRepositoryTest.php
View file @
a8295577
...
...
@@ -40,8 +40,8 @@ final class EloquentFolderRepositoryTest extends MediaTestCase
$this
->
assertCount
(
1
,
$this
->
folder
->
all
());
$this
->
assertEquals
(
'My Folder'
,
$folder
->
filename
);
$this
->
assertEquals
(
'/assets/media/my-folder'
,
$folder
->
path
->
getRelativeUrl
());
$this
->
assertTrue
(
$folder
->
is_folder
);
$this
->
assertTrue
(
$folder
->
isFolder
());
$this
->
assertTrue
(
$folder
->
is_folder
);
$this
->
assertTrue
(
$folder
->
isFolder
());
$this
->
assertEquals
(
0
,
$folder
->
folder_id
);
}
...
...
Modules/Media/Transformers/MediaTransformer.php
View file @
a8295577
...
...
@@ -31,8 +31,8 @@ class MediaTransformer extends Resource
'media_type'
=>
$this
->
media_type
,
'fa_icon'
=>
FileHelper
::
getFaIcon
(
$this
->
media_type
),
'created_at'
=>
$this
->
created_at
,
'small_thumb'
=>
$this
->
imagy
->
getThumbnail
(
$this
->
path
,
'smallThumb'
),
'medium_thumb'
=>
$this
->
imagy
->
getThumbnail
(
$this
->
path
,
'mediumThumb'
),
'small_thumb'
=>
$this
->
imagy
->
getThumbnail
(
$this
->
path
,
'smallThumb'
),
'medium_thumb'
=>
$this
->
imagy
->
getThumbnail
(
$this
->
path
,
'mediumThumb'
),
];
}
...
...
Modules/Menu/Repositories/Cache/CacheMenuDecorator.php
View file @
a8295577
...
...
@@ -27,7 +27,9 @@ class CacheMenuDecorator extends BaseCacheDecorator implements MenuRepository
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allOnline"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allOnline"
,
$this
->
cacheTime
,
function
()
{
return
$this
->
repository
->
allOnline
();
}
...
...
Modules/Menu/Repositories/Cache/CacheMenuItemDecorator.php
View file @
a8295577
...
...
@@ -29,7 +29,9 @@ class CacheMenuItemDecorator extends BaseCacheDecorator implements MenuItemRepos
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.rootsForMenu.
{
$menuId
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.rootsForMenu.
{
$menuId
}
"
,
$this
->
cacheTime
,
function
()
use
(
$menuId
)
{
return
$this
->
repository
->
rootsForMenu
(
$menuId
);
}
...
...
@@ -45,7 +47,9 @@ class CacheMenuItemDecorator extends BaseCacheDecorator implements MenuItemRepos
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.getForRoutes"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.getForRoutes"
,
$this
->
cacheTime
,
function
()
{
return
$this
->
repository
->
getForRoutes
();
}
...
...
@@ -62,7 +66,9 @@ class CacheMenuItemDecorator extends BaseCacheDecorator implements MenuItemRepos
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.getRootForMenu.
{
$menuId
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.getRootForMenu.
{
$menuId
}
"
,
$this
->
cacheTime
,
function
()
use
(
$menuId
)
{
return
$this
->
repository
->
getRootForMenu
(
$menuId
);
}
...
...
@@ -79,7 +85,9 @@ class CacheMenuItemDecorator extends BaseCacheDecorator implements MenuItemRepos
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.getTreeForMenu.
{
$menuId
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.getTreeForMenu.
{
$menuId
}
"
,
$this
->
cacheTime
,
function
()
use
(
$menuId
)
{
return
$this
->
repository
->
getTreeForMenu
(
$menuId
);
}
...
...
@@ -96,7 +104,9 @@ class CacheMenuItemDecorator extends BaseCacheDecorator implements MenuItemRepos
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allRootsForMenu.
{
$menuId
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allRootsForMenu.
{
$menuId
}
"
,
$this
->
cacheTime
,
function
()
use
(
$menuId
)
{
return
$this
->
repository
->
allRootsForMenu
(
$menuId
);
}
...
...
@@ -112,7 +122,9 @@ class CacheMenuItemDecorator extends BaseCacheDecorator implements MenuItemRepos
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findByUriInLanguage.
{
$uri
}
.
{
$locale
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findByUriInLanguage.
{
$uri
}
.
{
$locale
}
"
,
$this
->
cacheTime
,
function
()
use
(
$uri
,
$locale
)
{
return
$this
->
repository
->
findByUriInLanguage
(
$uri
,
$locale
);
}
...
...
Modules/Page/Repositories/Cache/CachePageDecorator.php
View file @
a8295577
...
...
@@ -31,7 +31,9 @@ class CachePageDecorator extends BaseCacheDecorator implements PageRepository
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findHomepage"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findHomepage"
,
$this
->
cacheTime
,
function
()
{
return
$this
->
repository
->
findHomepage
();
}
...
...
@@ -46,7 +48,9 @@ class CachePageDecorator extends BaseCacheDecorator implements PageRepository
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.countAll"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.countAll"
,
$this
->
cacheTime
,
function
()
{
return
$this
->
repository
->
countAll
();
}
...
...
@@ -62,7 +66,9 @@ class CachePageDecorator extends BaseCacheDecorator implements PageRepository
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findBySlugInLocale.
{
$slug
}
.
{
$locale
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findBySlugInLocale.
{
$slug
}
.
{
$locale
}
"
,
$this
->
cacheTime
,
function
()
use
(
$slug
,
$locale
)
{
return
$this
->
repository
->
findBySlugInLocale
(
$slug
,
$locale
);
}
...
...
@@ -85,7 +91,9 @@ class CachePageDecorator extends BaseCacheDecorator implements PageRepository
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.serverPaginationFilteringFor.
{
$key
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.serverPaginationFilteringFor.
{
$key
}
"
,
$this
->
cacheTime
,
function
()
use
(
$request
)
{
return
$this
->
repository
->
serverPaginationFilteringFor
(
$request
);
}
...
...
Modules/Setting/Http/Controllers/Admin/SettingController.php
View file @
a8295577
...
...
@@ -58,7 +58,9 @@ class SettingController extends AdminBaseController
$dbSettings
=
$this
->
setting
->
savedModuleSettings
(
$currentModule
->
getLowerName
());
return
view
(
'setting::admin.module-settings'
,
compact
(
'currentModule'
,
'translatableSettings'
,
'plainSettings'
,
'dbSettings'
,
'modulesWithSettings'
));
return
view
(
'setting::admin.module-settings'
,
compact
(
'currentModule'
,
'translatableSettings'
,
'plainSettings'
,
'dbSettings'
,
'modulesWithSettings'
)
);
}
}
Modules/Setting/Repositories/Cache/CacheSettingDecorator.php
View file @
a8295577
...
...
@@ -35,7 +35,9 @@ class CacheSettingDecorator extends BaseCacheDecorator implements SettingReposit
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findByName.
{
$settingName
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findByName.
{
$settingName
}
"
,
$this
->
cacheTime
,
function
()
use
(
$settingName
)
{
return
$this
->
repository
->
findByName
(
$settingName
);
}
...
...
@@ -54,7 +56,9 @@ class CacheSettingDecorator extends BaseCacheDecorator implements SettingReposit
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.moduleSettings.
{
$moduleList
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.moduleSettings.
{
$moduleList
}
"
,
$this
->
cacheTime
,
function
()
use
(
$modules
)
{
return
$this
->
repository
->
moduleSettings
(
$modules
);
}
...
...
@@ -70,7 +74,9 @@ class CacheSettingDecorator extends BaseCacheDecorator implements SettingReposit
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.savedModuleSettings.
{
$module
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.savedModuleSettings.
{
$module
}
"
,
$this
->
cacheTime
,
function
()
use
(
$module
)
{
return
$this
->
repository
->
savedModuleSettings
(
$module
);
}
...
...
@@ -86,7 +92,9 @@ class CacheSettingDecorator extends BaseCacheDecorator implements SettingReposit
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findByModule.
{
$module
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findByModule.
{
$module
}
"
,
$this
->
cacheTime
,
function
()
use
(
$module
)
{
return
$this
->
repository
->
findByModule
(
$module
);
}
...
...
@@ -102,7 +110,9 @@ class CacheSettingDecorator extends BaseCacheDecorator implements SettingReposit
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.get.
{
$settingName
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.get.
{
$settingName
}
"
,
$this
->
cacheTime
,
function
()
use
(
$settingName
)
{
return
$this
->
repository
->
get
(
$settingName
);
}
...
...
@@ -118,7 +128,9 @@ class CacheSettingDecorator extends BaseCacheDecorator implements SettingReposit
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.translatableModuleSettings.
{
$module
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.translatableModuleSettings.
{
$module
}
"
,
$this
->
cacheTime
,
function
()
use
(
$module
)
{
return
$this
->
repository
->
translatableModuleSettings
(
$module
);
}
...
...
@@ -134,7 +146,9 @@ class CacheSettingDecorator extends BaseCacheDecorator implements SettingReposit
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.plainModuleSettings.
{
$module
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.plainModuleSettings.
{
$module
}
"
,
$this
->
cacheTime
,
function
()
use
(
$module
)
{
return
$this
->
repository
->
plainModuleSettings
(
$module
);
}
...
...
Modules/Tag/Repositories/Cache/CacheTagDecorator.php
View file @
a8295577
...
...
@@ -23,7 +23,9 @@ class CacheTagDecorator extends BaseCacheDecorator implements TagRepository
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allForNamespace.
{
$namespace
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allForNamespace.
{
$namespace
}
"
,
$this
->
cacheTime
,
function
()
use
(
$namespace
)
{
return
$this
->
repository
->
allForNamespace
(
$namespace
);
}
...
...
Modules/Translation/Repositories/Cache/CacheTranslationDecorator.php
View file @
a8295577
...
...
@@ -27,7 +27,8 @@ class CacheTranslationDecorator extends BaseCacheDecorator implements Translatio
$locale
=
$locale
?:
app
()
->
getLocale
();
return
app
(
'cache'
)
->
driver
(
'translations'
)
->
rememberForever
(
"
{
$this
->
entityName
}
.findByKeyAndLocale.
{
$cleanKey
}
.
{
$locale
}
"
,
->
rememberForever
(
"
{
$this
->
entityName
}
.findByKeyAndLocale.
{
$cleanKey
}
.
{
$locale
}
"
,
function
()
use
(
$key
,
$locale
)
{
return
$this
->
repository
->
findByKeyAndLocale
(
$key
,
$locale
);
}
...
...
@@ -37,7 +38,8 @@ class CacheTranslationDecorator extends BaseCacheDecorator implements Translatio
public
function
allFormatted
()
{
return
app
(
'cache'
)
->
driver
(
'translations'
)
->
rememberForever
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allFormatted"
,
->
rememberForever
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allFormatted"
,
function
()
{
return
$this
->
repository
->
allFormatted
();
}
...
...
@@ -56,7 +58,8 @@ class CacheTranslationDecorator extends BaseCacheDecorator implements Translatio
$cleanKey
=
$this
->
cleanKey
(
$key
);
return
app
(
'cache'
)
->
driver
(
'translations'
)
->
rememberForever
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findTranslationByKey.
{
$cleanKey
}
"
,
->
rememberForever
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.findTranslationByKey.
{
$cleanKey
}
"
,
function
()
use
(
$key
)
{
return
$this
->
repository
->
findTranslationByKey
(
$key
);
}
...
...
@@ -102,7 +105,8 @@ class CacheTranslationDecorator extends BaseCacheDecorator implements Translatio
public
function
getTranslationsForGroupAndNamespace
(
$locale
,
$group
,
$namespace
)
{
return
app
(
'cache'
)
->
driver
(
'translations'
)
->
rememberForever
(
"
{
$this
->
entityName
}
.findByKeyAndLocale.
{
$locale
}
.
{
$group
}
.[
$namespace
]"
,
->
rememberForever
(
"
{
$this
->
entityName
}
.findByKeyAndLocale.
{
$locale
}
.
{
$group
}
.[
$namespace
]"
,
function
()
use
(
$locale
,
$group
,
$namespace
)
{
return
$this
->
repository
->
getTranslationsForGroupAndNamespace
(
$locale
,
$group
,
$namespace
);
}
...
...
Modules/User/Repositories/Cache/CacheUserTokenDecorator.php
View file @
a8295577
...
...
@@ -28,7 +28,9 @@ class CacheUserTokenDecorator extends BaseCacheDecorator implements UserTokenRep
{
return
$this
->
cache
->
tags
([
$this
->
entityName
,
'global'
])
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allForUser.
{
$userId
}
"
,
$this
->
cacheTime
,
->
remember
(
"
{
$this
->
locale
}
.
{
$this
->
entityName
}
.allForUser.
{
$userId
}
"
,
$this
->
cacheTime
,
function
()
use
(
$userId
)
{
return
$this
->
repository
->
allForUser
(
$userId
);
}
...
...
Modules/Workshop/Http/Controllers/Admin/ModulesController.php
View file @
a8295577
...
...
@@ -81,8 +81,10 @@ class ModulesController extends AdminBaseController
{
$module
->
enable
();
return
redirect
()
->
route
(
'admin.workshop.modules.show'
,
[
$module
->
getLowerName
()])
->
with
(
'success'
,
trans
(
'workshop::modules.module enabled'
));
return
redirect
()
->
route
(
'admin.workshop.modules.show'
,
[
$module
->
getLowerName
()])
->
with
(
'success'
,
trans
(
'workshop::modules.module enabled'
)
);
}
/**
...
...
Modules/Workshop/Http/backendRoutes.php
View file @
a8295577
...
...
@@ -10,7 +10,8 @@ $router->bind('theme', function ($theme) {
return
app
(
\Modules\Workshop\Manager\ThemeManager
::
class
)
->
find
(
$theme
);
});
$router
->
group
([
'prefix'
=>
'/workshop'
],
$router
->
group
(
[
'prefix'
=>
'/workshop'
],
function
(
Router
$router
)
{
$router
->
get
(
'modules'
,
[
'as'
=>
'admin.workshop.modules.index'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment