@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function handle() |
| 27 | 27 | { |
| 28 | - DB::transaction(function () { |
|
| 28 | + DB::transaction(function() { |
|
| 29 | 29 | app($this->modelClass)->saveTreeFromIds($this->ids); |
| 30 | 30 | }, 3); |
| 31 | 31 | } |
@@ -85,12 +85,12 @@ |
||
| 85 | 85 | { |
| 86 | 86 | foreach ($this->fieldsGroups as $group => $groupFields) { |
| 87 | 87 | if ($this->fieldsGroupsFormFieldNamesAutoPrefix) { |
| 88 | - $groupFields = array_map(function ($field_name) use ($group) { |
|
| 88 | + $groupFields = array_map(function($field_name) use ($group) { |
|
| 89 | 89 | return $group . $this->fieldsGroupsFormFieldNameSeparator . $field_name; |
| 90 | 90 | }, $groupFields); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - $fields[$group] = Arr::where(Arr::only($fields, $groupFields), function ($value, $key) { |
|
| 93 | + $fields[$group] = Arr::where(Arr::only($fields, $groupFields), function($value, $key) { |
|
| 94 | 94 | return !empty($value); |
| 95 | 95 | }); |
| 96 | 96 | |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | $middlewares, |
| 83 | 83 | $supportSubdomainRouting |
| 84 | 84 | ) { |
| 85 | - $internalRoutes = function ($router) use ( |
|
| 85 | + $internalRoutes = function($router) use ( |
|
| 86 | 86 | $middlewares, |
| 87 | 87 | $supportSubdomainRouting |
| 88 | 88 | ) { |
| 89 | - $router->group(['middleware' => $middlewares], function ($router) { |
|
| 89 | + $router->group(['middleware' => $middlewares], function($router) { |
|
| 90 | 90 | require __DIR__ . '/../routes/admin.php'; |
| 91 | 91 | }); |
| 92 | 92 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | ? ['supportSubdomainRouting'] |
| 97 | 97 | : [], |
| 98 | 98 | ], |
| 99 | - function ($router) { |
|
| 99 | + function($router) { |
|
| 100 | 100 | require __DIR__ . '/../routes/auth.php'; |
| 101 | 101 | } |
| 102 | 102 | ); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | ? ['twill_auth:twill_users'] |
| 108 | 108 | : [], |
| 109 | 109 | ], |
| 110 | - function ($router) { |
|
| 110 | + function($router) { |
|
| 111 | 111 | require __DIR__ . '/../routes/templates.php'; |
| 112 | 112 | } |
| 113 | 113 | ); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $groupOptions + [ |
| 118 | 118 | 'namespace' => $this->namespace . '\Admin', |
| 119 | 119 | ], |
| 120 | - function ($router) use ($internalRoutes, $supportSubdomainRouting) { |
|
| 120 | + function($router) use ($internalRoutes, $supportSubdomainRouting) { |
|
| 121 | 121 | $router->group( |
| 122 | 122 | [ |
| 123 | 123 | 'domain' => config('twill.admin_app_url'), |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | config('twill.admin_middleware_group', 'web'), |
| 149 | 149 | ], |
| 150 | 150 | ], |
| 151 | - function ($router) { |
|
| 151 | + function($router) { |
|
| 152 | 152 | $router->group( |
| 153 | 153 | [ |
| 154 | 154 | 'middleware' => $this->app->environment( |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | ? ['twill_auth:twill_users'] |
| 158 | 158 | : [], |
| 159 | 159 | ], |
| 160 | - function ($router) { |
|
| 160 | + function($router) { |
|
| 161 | 161 | require __DIR__ . '/../routes/templates.php'; |
| 162 | 162 | } |
| 163 | 163 | ); |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | protected function registerMacros() |
| 212 | 212 | { |
| 213 | - Route::macro('moduleShowWithPreview', function ( |
|
| 213 | + Route::macro('moduleShowWithPreview', function( |
|
| 214 | 214 | $moduleName, |
| 215 | 215 | $routePrefix = null, |
| 216 | 216 | $controllerName = null |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | ->middleware(['web', 'twill_auth:twill_users', 'can:list']); |
| 245 | 245 | }); |
| 246 | 246 | |
| 247 | - Route::macro('module', function ( |
|
| 247 | + Route::macro('module', function( |
|
| 248 | 248 | $slug, |
| 249 | 249 | $options = [], |
| 250 | 250 | $resource_options = [], |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $_slug = Arr::last($slugs); |
| 256 | 256 | $className = implode( |
| 257 | 257 | '', |
| 258 | - array_map(function ($s) { |
|
| 258 | + array_map(function($s) { |
|
| 259 | 259 | return ucfirst(Str::singular($s)); |
| 260 | 260 | }, $slugs) |
| 261 | 261 | ); |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | if ($resource) { |
| 381 | 381 | Route::group( |
| 382 | 382 | ['as' => $resourceCustomGroupPrefix], |
| 383 | - function () use ($slug, $className, $resource_options) { |
|
| 383 | + function() use ($slug, $className, $resource_options) { |
|
| 384 | 384 | Route::resource( |
| 385 | 385 | $slug, |
| 386 | 386 | "{$className}Controller", |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | } |
| 392 | 392 | }); |
| 393 | 393 | |
| 394 | - Route::macro('singleton', function ( |
|
| 394 | + Route::macro('singleton', function( |
|
| 395 | 395 | $slug, |
| 396 | 396 | $options = [], |
| 397 | 397 | $resource_options = [], |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * @param bool $absolute |
| 13 | 13 | * @return string |
| 14 | 14 | */ |
| 15 | - function moduleRoute($moduleName, $prefix, $action='', $parameters = [], $absolute = true) |
|
| 15 | + function moduleRoute($moduleName, $prefix, $action = '', $parameters = [], $absolute = true) |
|
| 16 | 16 | { |
| 17 | 17 | // Fix module name case |
| 18 | 18 | $moduleName = Str::camel($moduleName); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | return $list |
| 28 | 28 | ->where('enabled', true) |
| 29 | - ->map(function ($capsule) use ($path) { |
|
| 29 | + ->map(function($capsule) use ($path) { |
|
| 30 | 30 | return $this->makeCapsule($capsule, $path); |
| 31 | 31 | }); |
| 32 | 32 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | public function getCapsuleByModule($module) |
| 42 | 42 | { |
| 43 | 43 | return $this->getCapsuleList() |
| 44 | - ->filter(function ($capsule) use ($module) { |
|
| 44 | + ->filter(function($capsule) use ($module) { |
|
| 45 | 45 | return Str::lower($capsule['plural']) == Str::lower($module); |
| 46 | 46 | }) |
| 47 | 47 | ->first(); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | { |
| 270 | 270 | $twillSeeder = app(CapsuleSeeder::class); |
| 271 | 271 | |
| 272 | - $this->getCapsuleList()->each(function ($capsule) use ( |
|
| 272 | + $this->getCapsuleList()->each(function($capsule) use ( |
|
| 273 | 273 | $twillSeeder, |
| 274 | 274 | $illuminateSeeder |
| 275 | 275 | ) { |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | return; |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | - collect($files)->each(function ($file) { |
|
| 383 | + collect($files)->each(function($file) { |
|
| 384 | 384 | if (file_exists($file)) { |
| 385 | 385 | require_once $file; |
| 386 | 386 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $domain = config('twill.twicpics.domain'); |
| 98 | 98 | $path = config('twill.twicpics.path'); |
| 99 | 99 | |
| 100 | - if (! empty($path)) { |
|
| 100 | + if (!empty($path)) { |
|
| 101 | 101 | $path = "{$path}/"; |
| 102 | 102 | } |
| 103 | 103 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | $params = $this->paramsProcessor->process($params); |
| 128 | 128 | |
| 129 | - $manipulations = collect($params)->map(function ($value, $key) { |
|
| 129 | + $manipulations = collect($params)->map(function($value, $key) { |
|
| 130 | 130 | return "{$key}={$value}"; |
| 131 | 131 | })->join('/'); |
| 132 | 132 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | public function getAncestorsSlug($locale = null) |
| 39 | 39 | { |
| 40 | 40 | return collect($this->ancestors ?? []) |
| 41 | - ->map(function ($i) use ($locale) { return $i->getSlug($locale); }) |
|
| 41 | + ->map(function($i) use ($locale) { return $i->getSlug($locale); }) |
|
| 42 | 42 | ->implode('/'); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | "$this->viewPrefix.index", |
| 362 | 362 | "twill::$this->moduleName.index", |
| 363 | 363 | "twill::layouts.listing", |
| 364 | - ])->first(function ($view) { |
|
| 364 | + ])->first(function($view) { |
|
| 365 | 365 | return View::exists($view); |
| 366 | 366 | }); |
| 367 | 367 | |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | "$this->viewPrefix.form", |
| 471 | 471 | "twill::$this->moduleName.form", |
| 472 | 472 | "twill::layouts.form", |
| 473 | - ])->first(function ($view) { |
|
| 473 | + ])->first(function($view) { |
|
| 474 | 474 | return View::exists($view); |
| 475 | 475 | }); |
| 476 | 476 | |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | "$this->viewPrefix.form", |
| 502 | 502 | "twill::$this->moduleName.form", |
| 503 | 503 | "twill::layouts.form", |
| 504 | - ])->first(function ($view) { |
|
| 504 | + ])->first(function($view) { |
|
| 505 | 505 | return View::exists($view); |
| 506 | 506 | }); |
| 507 | 507 | |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | "$this->viewPrefix.form", |
| 630 | 630 | "twill::$this->moduleName.form", |
| 631 | 631 | "twill::layouts.form", |
| 632 | - ])->first(function ($view) { |
|
| 632 | + ])->first(function($view) { |
|
| 633 | 633 | return View::exists($view); |
| 634 | 634 | }); |
| 635 | 635 | |
@@ -891,7 +891,7 @@ discard block |
||
| 891 | 891 | $query = $this->request->input('q'); |
| 892 | 892 | $tags = $this->repository->getTags($query); |
| 893 | 893 | |
| 894 | - return Response::json(['items' => $tags->map(function ($tag) { |
|
| 894 | + return Response::json(['items' => $tags->map(function($tag) { |
|
| 895 | 895 | return $tag->name; |
| 896 | 896 | })], 200); |
| 897 | 897 | } |
@@ -979,8 +979,8 @@ discard block |
||
| 979 | 979 | protected function getIndexTableData($items) |
| 980 | 980 | { |
| 981 | 981 | $translated = $this->moduleHas('translations'); |
| 982 | - return $items->map(function ($item) use ($translated) { |
|
| 983 | - $columnsData = Collection::make($this->indexColumns)->mapWithKeys(function ($column) use ($item) { |
|
| 982 | + return $items->map(function($item) use ($translated) { |
|
| 983 | + $columnsData = Collection::make($this->indexColumns)->mapWithKeys(function($column) use ($item) { |
|
| 984 | 984 | return $this->getItemColumnData($item, $column); |
| 985 | 985 | })->toArray(); |
| 986 | 986 | |
@@ -1240,7 +1240,7 @@ discard block |
||
| 1240 | 1240 | 'feature', |
| 1241 | 1241 | 'bulkFeature', |
| 1242 | 1242 | 'bulkDelete', |
| 1243 | - ])->mapWithKeys(function ($endpoint) { |
|
| 1243 | + ])->mapWithKeys(function($endpoint) { |
|
| 1244 | 1244 | return [ |
| 1245 | 1245 | $endpoint . 'Url' => $this->getIndexOption($endpoint) ? moduleRoute( |
| 1246 | 1246 | $this->moduleName, |
@@ -1258,7 +1258,7 @@ discard block |
||
| 1258 | 1258 | */ |
| 1259 | 1259 | protected function getIndexOption($option) |
| 1260 | 1260 | { |
| 1261 | - return once(function () use ($option) { |
|
| 1261 | + return once(function() use ($option) { |
|
| 1262 | 1262 | $customOptionNamesMapping = [ |
| 1263 | 1263 | 'store' => 'create', |
| 1264 | 1264 | ]; |
@@ -1315,8 +1315,8 @@ discard block |
||
| 1315 | 1315 | { |
| 1316 | 1316 | $withImage = $this->moduleHas('medias'); |
| 1317 | 1317 | |
| 1318 | - return $items->map(function ($item) use ($withImage) { |
|
| 1319 | - $columnsData = Collection::make($this->browserColumns)->mapWithKeys(function ($column) use ($item) { |
|
| 1318 | + return $items->map(function($item) use ($withImage) { |
|
| 1319 | + $columnsData = Collection::make($this->browserColumns)->mapWithKeys(function($column) use ($item) { |
|
| 1320 | 1320 | return $this->getItemColumnData($item, $column); |
| 1321 | 1321 | })->toArray(); |
| 1322 | 1322 | |
@@ -1382,7 +1382,7 @@ discard block |
||
| 1382 | 1382 | $fieldSplitted = explode('|', $field); |
| 1383 | 1383 | if (count($fieldSplitted) > 1) { |
| 1384 | 1384 | $requestValue = $requestFilters[$key]; |
| 1385 | - Collection::make($fieldSplitted)->each(function ($scopeKey) use (&$scope, $requestValue) { |
|
| 1385 | + Collection::make($fieldSplitted)->each(function($scopeKey) use (&$scope, $requestValue) { |
|
| 1386 | 1386 | $scope[$scopeKey] = $requestValue; |
| 1387 | 1387 | }); |
| 1388 | 1388 | } else { |
@@ -1558,11 +1558,11 @@ discard block |
||
| 1558 | 1558 | */ |
| 1559 | 1559 | protected function validateFormRequest() |
| 1560 | 1560 | { |
| 1561 | - $unauthorizedFields = Collection::make($this->fieldsPermissions)->filter(function ($permission, $field) { |
|
| 1561 | + $unauthorizedFields = Collection::make($this->fieldsPermissions)->filter(function($permission, $field) { |
|
| 1562 | 1562 | return Auth::guard('twill_users')->user()->cannot($permission); |
| 1563 | 1563 | })->keys(); |
| 1564 | 1564 | |
| 1565 | - $unauthorizedFields->each(function ($field) { |
|
| 1565 | + $unauthorizedFields->each(function($field) { |
|
| 1566 | 1566 | $this->request->offsetUnset($field); |
| 1567 | 1567 | }); |
| 1568 | 1568 | |
@@ -1614,7 +1614,7 @@ discard block |
||
| 1614 | 1614 | $singularName = Str::singular($name); |
| 1615 | 1615 | $modelClass = config('twill.namespace') . '\\Models\\' . Str::studly($singularName); |
| 1616 | 1616 | |
| 1617 | - if(!class_exists($modelClass)) { |
|
| 1617 | + if (!class_exists($modelClass)) { |
|
| 1618 | 1618 | $modelClass = $this->getCapsuleByModule($name)['model']; |
| 1619 | 1619 | } |
| 1620 | 1620 | |
@@ -1860,7 +1860,7 @@ discard block |
||
| 1860 | 1860 | */ |
| 1861 | 1861 | public function getRepeaterList() |
| 1862 | 1862 | { |
| 1863 | - return app(BlockCollection::class)->getRepeaterList()->mapWithKeys(function ($repeater) { |
|
| 1863 | + return app(BlockCollection::class)->getRepeaterList()->mapWithKeys(function($repeater) { |
|
| 1864 | 1864 | return [$repeater['name'] => $repeater]; |
| 1865 | 1865 | }); |
| 1866 | 1866 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | 'hasPosition', |
| 208 | 208 | 'hasRevisions', |
| 209 | 209 | 'hasNesting', |
| 210 | - ])->filter(function ($enabled) { |
|
| 210 | + ])->filter(function($enabled) { |
|
| 211 | 211 | return $enabled; |
| 212 | 212 | }); |
| 213 | 213 | |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | $start = "{$delimiters[0]}{$key}{$delimiters[1]}"; |
| 832 | 832 | $end = "{$delimiters[0]}\/{$key}{$delimiters[1]}"; |
| 833 | 833 | |
| 834 | - if ((bool)$value) { |
|
| 834 | + if ((bool) $value) { |
|
| 835 | 835 | // replace delimiters only |
| 836 | 836 | $stub = preg_replace("/$start/", '', $stub); |
| 837 | 837 | $stub = preg_replace("/$end/", '', $stub); |