@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | $inputs = array_build( |
| 30 | 30 | \localizer\locales(), |
| 31 | - function ($key, $locale) use ($repository, $current, &$cycle, $translations) { |
|
| 31 | + function($key, $locale) use ($repository, $current, &$cycle, $translations) { |
|
| 32 | 32 | $element = $this->selfClone($locale, $repository); |
| 33 | 33 | |
| 34 | 34 | if ($translations->readonly($locale)) { |
@@ -134,8 +134,8 @@ |
||
| 134 | 134 | ])->render(); |
| 135 | 135 | |
| 136 | 136 | return $pdf->loadHTML($html) |
| 137 | - ->setPaper('a4', 'landscape') |
|
| 138 | - ->download(app('scaffold.module')->url().'.pdf'); |
|
| 137 | + ->setPaper('a4', 'landscape') |
|
| 138 | + ->download(app('scaffold.module')->url().'.pdf'); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | return $query |
| 156 | - ->when($query->getModel() instanceof Translatable, function ($query) { |
|
| 156 | + ->when($query->getModel() instanceof Translatable, function($query) { |
|
| 157 | 157 | $query->translated(); |
| 158 | 158 | }) |
| 159 | 159 | // leave select after joining with translations |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | protected function toScalar($object): array |
| 170 | 170 | { |
| 171 | - return array_filter($object->toArray(), function ($item) { |
|
| 171 | + return array_filter($object->toArray(), function($item) { |
|
| 172 | 172 | return is_scalar($item); |
| 173 | 173 | }); |
| 174 | 174 | } |
@@ -260,13 +260,13 @@ discard block |
||
| 260 | 260 | return collect($model->getFillable()) |
| 261 | 261 | ->prepend('id') |
| 262 | 262 | ->diff($model->getHidden()) |
| 263 | - ->map(function ($column) use ($model) { |
|
| 263 | + ->map(function($column) use ($model) { |
|
| 264 | 264 | return "{$model->getTable()}.{$column}"; |
| 265 | 265 | }) |
| 266 | - ->when($model instanceof Translatable, function (Collection $collection) use ($model) { |
|
| 266 | + ->when($model instanceof Translatable, function(Collection $collection) use ($model) { |
|
| 267 | 267 | return $collection->merge( |
| 268 | 268 | collect($model->getTranslatedAttributes()) |
| 269 | - ->map(function ($column) use ($model) { |
|
| 269 | + ->map(function($column) use ($model) { |
|
| 270 | 270 | return "tt.{$column}"; |
| 271 | 271 | }) |
| 272 | 272 | ); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $objects = $objects->toArray(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - usort($objects, function ($aObj, $bObj) { |
|
| 26 | + usort($objects, function($aObj, $bObj) { |
|
| 27 | 27 | [$aRank, $bRank] = $this->getRanks($aObj, $bObj); |
| 28 | 28 | |
| 29 | 29 | if ($this->equals($aRank, $bRank)) { |
@@ -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 | } |