@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function allOnlineInLang($lang) |
| 51 | 51 | { |
| 52 | - return $this->model->whereHas('translations', function (Builder $q) use ($lang) { |
|
| 52 | + return $this->model->whereHas('translations', function(Builder $q) use ($lang) { |
|
| 53 | 53 | $q->where('locale', "$lang"); |
| 54 | 54 | $q->where('online', true); |
| 55 | 55 | })->with('translations')->orderBy('created_at', 'DESC')->get(); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | $lang = $this->getCurrentLocale(); |
| 66 | 66 | |
| 67 | - $block = $this->model->whereHas('translations', function (Builder $q) use ($lang) { |
|
| 67 | + $block = $this->model->whereHas('translations', function(Builder $q) use ($lang) { |
|
| 68 | 68 | $q->where('locale', "$lang"); |
| 69 | 69 | $q->where('online', true); |
| 70 | 70 | })->with('translations')->whereName($name)->first(); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | private function sluggify(array &$data) |
| 89 | 89 | { |
| 90 | - $data['name'] = $this->makeNameUnique($data['name']); |
|
| 90 | + $data[ 'name' ] = $this->makeNameUnique($data[ 'name' ]); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
@@ -103,20 +103,20 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | if ( |
| 105 | 105 | $this->isEmptyArray($list) || |
| 106 | - ! $this->isSlugInList($slug, $list) || |
|
| 106 | + !$this->isSlugInList($slug, $list) || |
|
| 107 | 107 | ($this->isForModel($list) && $this->slugIsInList($slug, $list)) |
| 108 | 108 | ) { |
| 109 | 109 | return $slug; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | // map our list to keep only the increments |
| 113 | - $len = strlen($slug . '-'); |
|
| 113 | + $len = strlen($slug.'-'); |
|
| 114 | 114 | |
| 115 | - array_walk($list, function (&$value, $key) use ($len) { |
|
| 115 | + array_walk($list, function(&$value, $key) use ($len) { |
|
| 116 | 116 | $value = intval(substr($value, $len)); |
| 117 | 117 | }); |
| 118 | 118 | |
| 119 | - return $slug . '-' . $this->findHighestIncrement($list); |
|
| 119 | + return $slug.'-'.$this->findHighestIncrement($list); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | private function getExistingSlugs($slug) |
| 128 | 128 | { |
| 129 | - $query = $this->model->where('name', 'LIKE', $slug . '%'); |
|
| 129 | + $query = $this->model->where('name', 'LIKE', $slug.'%'); |
|
| 130 | 130 | |
| 131 | 131 | $list = $query->lists('name', $this->model->getKeyName())->toArray(); |
| 132 | 132 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | private function slugIsInList($slug, array $list) |
| 174 | 174 | { |
| 175 | - return $list[$this->model->getKey()] === $slug; |
|
| 175 | + return $list[ $this->model->getKey() ] === $slug; |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | /** |
@@ -45,14 +45,14 @@ |
||
| 45 | 45 | |
| 46 | 46 | protected function getEnvironmentSetUp($app) |
| 47 | 47 | { |
| 48 | - $app['path.base'] = __DIR__ . '/..'; |
|
| 49 | - $app['config']->set('database.default', 'sqlite'); |
|
| 50 | - $app['config']->set('database.connections.sqlite', array( |
|
| 48 | + $app[ 'path.base' ] = __DIR__.'/..'; |
|
| 49 | + $app[ 'config' ]->set('database.default', 'sqlite'); |
|
| 50 | + $app[ 'config' ]->set('database.connections.sqlite', array( |
|
| 51 | 51 | 'driver' => 'sqlite', |
| 52 | 52 | 'database' => ':memory:', |
| 53 | 53 | 'prefix' => '', |
| 54 | 54 | )); |
| 55 | - $app['config']->set('translatable.locales', ['en', 'fr']); |
|
| 55 | + $app[ 'config' ]->set('translatable.locales', [ 'en', 'fr' ]); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | private function resetDatabase() |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function boot() |
| 28 | 28 | { |
| 29 | - $this->mergeConfigFrom(__DIR__ . '/../Config/config.php', 'asgard.block.config'); |
|
| 30 | - $this->publishes([__DIR__ . '/../Config/config.php' => config_path('asgard.block.config' . '.php'), ], 'config'); |
|
| 29 | + $this->mergeConfigFrom(__DIR__.'/../Config/config.php', 'asgard.block.config'); |
|
| 30 | + $this->publishes([ __DIR__.'/../Config/config.php' => config_path('asgard.block.config'.'.php'), ], 'config'); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $this->app->bind( |
| 45 | 45 | 'Modules\Block\Repositories\BlockRepository', |
| 46 | - function () { |
|
| 46 | + function() { |
|
| 47 | 47 | $repository = new EloquentBlockRepository(new Block()); |
| 48 | 48 | |
| 49 | - if (! config('app.cache')) { |
|
| 49 | + if (!config('app.cache')) { |
|
| 50 | 50 | return $repository; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | protected function getBackendRoute() |
| 25 | 25 | { |
| 26 | - return __DIR__ . '/../Http/backendRoutes.php'; |
|
| 26 | + return __DIR__.'/../Http/backendRoutes.php'; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -4,10 +4,10 @@ |
||
| 4 | 4 | |
| 5 | 5 | /** @var Router $router */ |
| 6 | 6 | |
| 7 | -$router->bind('block', function ($id) { |
|
| 7 | +$router->bind('block', function($id) { |
|
| 8 | 8 | return app(\Modules\Block\Repositories\BlockRepository::class)->find($id); |
| 9 | 9 | }); |
| 10 | -$router->group(['prefix' => '/block'], function (Router $router) { |
|
| 10 | +$router->group([ 'prefix' => '/block' ], function(Router $router) { |
|
| 11 | 11 | $router->get('blocks', [ |
| 12 | 12 | 'as' => 'admin.block.block.index', |
| 13 | 13 | 'uses' => 'BlockController@index', |
@@ -32,6 +32,6 @@ |
||
| 32 | 32 | |
| 33 | 33 | public function messages() |
| 34 | 34 | { |
| 35 | - return []; |
|
| 35 | + return [ ]; |
|
| 36 | 36 | } |
| 37 | 37 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | return $this->cache |
| 23 | 23 | ->tags($this->entityName, 'global') |
| 24 | 24 | ->remember("{$this->locale}.{$this->entityName}.allOnlineInLang", $this->cacheTime, |
| 25 | - function () use ($lang) { |
|
| 25 | + function() use ($lang) { |
|
| 26 | 26 | return $this->repository->allOnlineInLang($lang); |
| 27 | 27 | } |
| 28 | 28 | ); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | return $this->cache |
| 39 | 39 | ->tags($this->entityName, 'global') |
| 40 | 40 | ->remember("{$this->locale}.{$this->entityName}.get.{$name}", $this->cacheTime, |
| 41 | - function () use ($name) { |
|
| 41 | + function() use ($name) { |
|
| 42 | 42 | return $this->repository->get($name); |
| 43 | 43 | } |
| 44 | 44 | ); |
@@ -10,12 +10,12 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | 'partials' => [ |
| 12 | 12 | 'translatable' => [ |
| 13 | - 'create' => [], |
|
| 14 | - 'edit' => [], |
|
| 13 | + 'create' => [ ], |
|
| 14 | + 'edit' => [ ], |
|
| 15 | 15 | ], |
| 16 | 16 | 'normal' => [ |
| 17 | - 'create' => [], |
|
| 18 | - 'edit' => [], |
|
| 17 | + 'create' => [ ], |
|
| 18 | + 'edit' => [ ], |
|
| 19 | 19 | ], |
| 20 | 20 | ], |
| 21 | 21 | |