@@ -154,7 +154,7 @@ |
||
| 154 | 154 | { |
| 155 | 155 | return array_merge( |
| 156 | 156 | ['index' => "administrator::{$namespace}"], |
| 157 | - array_build($views, function ($key, $view) use ($namespace) { |
|
| 157 | + array_build($views, function($key, $view) use ($namespace) { |
|
| 158 | 158 | return [$view, "administrator::{$namespace}.{$view}"]; |
| 159 | 159 | }) |
| 160 | 160 | ); |
@@ -65,8 +65,8 @@ |
||
| 65 | 65 | // prevent duplicated execution |
| 66 | 66 | if (null === $this->query && $this->model) { |
| 67 | 67 | $this->initQuery() |
| 68 | - ->applyFilters() |
|
| 69 | - ->applySorting(); |
|
| 68 | + ->applyFilters() |
|
| 69 | + ->applySorting(); |
|
| 70 | 70 | |
| 71 | 71 | $this->query = $this->assembler()->getQuery(); |
| 72 | 72 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | $this->index(); |
| 84 | 84 | |
| 85 | - $this->register('edit', function (Generator $breadcrumbs) { |
|
| 85 | + $this->register('edit', function(Generator $breadcrumbs) { |
|
| 86 | 86 | $breadcrumbs->parent('index'); |
| 87 | 87 | |
| 88 | 88 | $breadcrumbs->push(trans('administrator::module.action.edit', [ |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | protected function index() |
| 96 | 96 | { |
| 97 | - $this->register('index', function (Generator $breadcrumbs) { |
|
| 97 | + $this->register('index', function(Generator $breadcrumbs) { |
|
| 98 | 98 | $breadcrumbs->push($this->module->title(), route('scaffold.index', [ |
| 99 | 99 | 'module' => $this->module->url(), |
| 100 | 100 | ])); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $this->index(); |
| 107 | 107 | |
| 108 | - $this->register('create', function (Generator $breadcrumbs) { |
|
| 108 | + $this->register('create', function(Generator $breadcrumbs) { |
|
| 109 | 109 | $breadcrumbs->parent('index'); |
| 110 | 110 | $breadcrumbs->push(trans('administrator::module.action.create', [ |
| 111 | 111 | 'resource' => $this->module->singular(), |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | $this->index(); |
| 119 | 119 | |
| 120 | - $this->register('view', function (Generator $breadcrumbs) { |
|
| 120 | + $this->register('view', function(Generator $breadcrumbs) { |
|
| 121 | 121 | $breadcrumbs->parent('index'); |
| 122 | 122 | $breadcrumbs->push(trans('administrator::module.action.view', [ |
| 123 | 123 | 'resource' => $this->module->singular(), |
@@ -103,12 +103,12 @@ |
||
| 103 | 103 | glob(resource_path("{$path}/*.php")) |
| 104 | 104 | ); |
| 105 | 105 | |
| 106 | - $files = $files->map(function ($file) { |
|
| 106 | + $files = $files->map(function($file) { |
|
| 107 | 107 | return str_replace_last('.php', '', basename($file)); |
| 108 | 108 | }, $files); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - return $files->when($only, function (Collection $files) use ($only) { |
|
| 111 | + return $files->when($only, function(Collection $files) use ($only) { |
|
| 112 | 112 | return $files->intersect(is_array($only) ? $only : [$only]); |
| 113 | 113 | }); |
| 114 | 114 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function sync() |
| 70 | 70 | { |
| 71 | - $this->connection()->transaction(function () { |
|
| 71 | + $this->connection()->transaction(function() { |
|
| 72 | 72 | foreach ($this->editable() as $field) { |
| 73 | 73 | // get original HTML input |
| 74 | 74 | $name = $field->id(); |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | $keys = explode('.', $this->getQualifiedRelatedKeyName($relation)); |
| 263 | 263 | $key = array_pop($keys); |
| 264 | 264 | |
| 265 | - return array_filter((array) $values[$key], function ($value) { |
|
| 265 | + return array_filter((array) $values[$key], function($value) { |
|
| 266 | 266 | return null !== $value; |
| 267 | 267 | }); |
| 268 | 268 | } |
@@ -54,14 +54,14 @@ |
||
| 54 | 54 | |
| 55 | 55 | public function toArray() |
| 56 | 56 | { |
| 57 | - $params = array_build($this->params, function ($index, $param) { |
|
| 57 | + $params = array_build($this->params, function($index, $param) { |
|
| 58 | 58 | if (is_string($param)) { |
| 59 | 59 | return [$param, $this->request->get($param, null)]; |
| 60 | 60 | } |
| 61 | 61 | }); |
| 62 | 62 | |
| 63 | 63 | if ($this->isStrictMode()) { |
| 64 | - $params = array_filter($params, function ($item) { |
|
| 64 | + $params = array_filter($params, function($item) { |
|
| 65 | 65 | return null !== $item; |
| 66 | 66 | }); |
| 67 | 67 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | return collect([]) |
| 47 | 47 | ->merge($this->filesystem->files($directory)) |
| 48 | - ->map(function ($file) { |
|
| 48 | + ->map(function($file) { |
|
| 49 | 49 | return new File($file, $this); |
| 50 | 50 | }); |
| 51 | 51 | } |
@@ -60,14 +60,14 @@ discard block |
||
| 60 | 60 | public function directories($directory) |
| 61 | 61 | { |
| 62 | 62 | return collect($this->filesystem->directories($directory)) |
| 63 | - ->map(function ($file) { |
|
| 63 | + ->map(function($file) { |
|
| 64 | 64 | return new File($file, $this); |
| 65 | 65 | }); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | public function mkdir($name, $basename = null) |
| 69 | 69 | { |
| 70 | - $directory = array_filter([$this->path($basename), $name], function ($item) { |
|
| 70 | + $directory = array_filter([$this->path($basename), $name], function($item) { |
|
| 71 | 71 | return null !== $item; |
| 72 | 72 | }); |
| 73 | 73 | |
@@ -110,15 +110,15 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | public function delete($files = [], $directories = []) |
| 112 | 112 | { |
| 113 | - collect($files)->map(function ($file) { |
|
| 113 | + collect($files)->map(function($file) { |
|
| 114 | 114 | return $this->compilePath([$this->basename(), $file]); |
| 115 | - })->each(function ($file) { |
|
| 115 | + })->each(function($file) { |
|
| 116 | 116 | $this->filesystem->delete($file); |
| 117 | 117 | }); |
| 118 | 118 | |
| 119 | - collect($directories)->map(function ($file) { |
|
| 119 | + collect($directories)->map(function($file) { |
|
| 120 | 120 | return $this->compilePath([$this->basename(), $file]); |
| 121 | - })->each(function ($file) { |
|
| 121 | + })->each(function($file) { |
|
| 122 | 122 | $this->filesystem->deleteDirectory($file); |
| 123 | 123 | }); |
| 124 | 124 | } |
@@ -17,8 +17,8 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function read(Collection $files, Collection $locales) |
| 19 | 19 | { |
| 20 | - return $locales->reduce(function ($translations, $locale) use ($files) { |
|
| 21 | - $files->each(function ($file) use ($locale, &$translations) { |
|
| 20 | + return $locales->reduce(function($translations, $locale) use ($files) { |
|
| 21 | + $files->each(function($file) use ($locale, &$translations) { |
|
| 22 | 22 | if (file_exists($path = $this->pathToFile($file, $locale))) { |
| 23 | 23 | $content[$file] = include_once $path; |
| 24 | 24 | |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | public function setFilters(Mutable $filters = null) |
| 56 | 56 | { |
| 57 | 57 | if ($filters) { |
| 58 | - $filters = $filters->map(function ($element) { |
|
| 58 | + $filters = $filters->map(function($element) { |
|
| 59 | 59 | if ($this->request->has($id = $element->id())) { |
| 60 | 60 | $element->getInput()->setValue( |
| 61 | 61 | $this->request->get($id) |