@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function firstWithModel($model) |
| 15 | 15 | { |
| 16 | - return app('scaffold.modules')->first(function ($module) use ($model) { |
|
| 16 | + return app('scaffold.modules')->first(function($module) use ($model) { |
|
| 17 | 17 | return get_class($module->model()) === get_class($model); |
| 18 | 18 | }); |
| 19 | 19 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * |
| 84 | 84 | * @example: $element->display('<a href="mailto:(:email)">(:email)</a>'); |
| 85 | 85 | */ |
| 86 | - return preg_replace_callback('~\(\:([a-z0-9\_]+)\)~si', function ($matches) use ($eloquent) { |
|
| 86 | + return preg_replace_callback('~\(\:([a-z0-9\_]+)\)~si', function($matches) use ($eloquent) { |
|
| 87 | 87 | $field = $matches[1]; |
| 88 | 88 | |
| 89 | 89 | return \admin\helpers\eloquent_attribute($eloquent, $field); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | public function sortable(\Closure $callback = null) |
| 130 | 130 | { |
| 131 | - return tap($this, function ($element) use ($callback) { |
|
| 131 | + return tap($this, function($element) use ($callback) { |
|
| 132 | 132 | app('scaffold.module')->addSortable( |
| 133 | 133 | $element->id(), |
| 134 | 134 | $callback |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function unSortable() |
| 145 | 145 | { |
| 146 | - return tap($this, function ($element) { |
|
| 146 | + return tap($this, function($element) { |
|
| 147 | 147 | app('scaffold.module')->removeSortable($element->id()); |
| 148 | 148 | }); |
| 149 | 149 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | public function getDecorator() |
| 20 | 20 | { |
| 21 | - return function ($row) { |
|
| 21 | + return function($row) { |
|
| 22 | 22 | return $this->presentable($row) |
| 23 | 23 | ? $this->present($row, $this->name) |
| 24 | 24 | : $this->render($row); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | |
| 335 | 335 | $fillable = array_merge($fillable, $model->getDates()); |
| 336 | 336 | |
| 337 | - $fillable = array_filter($fillable, function ($element) use ($model) { |
|
| 337 | + $fillable = array_filter($fillable, function($element) use ($model) { |
|
| 338 | 338 | return !in_array($element, $model->getHidden(), true); |
| 339 | 339 | }); |
| 340 | 340 | |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | $aHeight = (int) array_get($attributes, 'height'); |
| 457 | 457 | |
| 458 | 458 | if (($aWidth || $aHeight) && $firstStyle) { |
| 459 | - $size = array_filter($styles, function ($style) use ($firstStyle) { |
|
| 459 | + $size = array_filter($styles, function($style) use ($firstStyle) { |
|
| 460 | 460 | return $style === $firstStyle; |
| 461 | 461 | }); |
| 462 | 462 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | { |
| 19 | 19 | $media = $this->getRepository()->getMedia( |
| 20 | 20 | $name = $this->getFormName() |
| 21 | - )->map(function ($item) { |
|
| 21 | + )->map(function($item) { |
|
| 22 | 22 | return array_merge($item->toArray(), [ |
| 23 | 23 | 'url' => $item->getUrl(), |
| 24 | 24 | 'conversions' => $this->conversions($item), |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | protected function conversions(\Spatie\MediaLibrary\Models\Media $item) |
| 40 | 40 | { |
| 41 | - return array_build($item->getMediaConversionNames(), function ($key, $conversion) use ($item) { |
|
| 41 | + return array_build($item->getMediaConversionNames(), function($key, $conversion) use ($item) { |
|
| 42 | 42 | return [$conversion, $item->getUrl($conversion)]; |
| 43 | 43 | }); |
| 44 | 44 | } |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | { |
| 94 | 94 | $this->validateEditor($editor); |
| 95 | 95 | |
| 96 | - return (bool) $this->filter(function ($field) use ($editor) { |
|
| 96 | + return (bool) $this->filter(function($field) use ($editor) { |
|
| 97 | 97 | if ('ckeditor' === $editor) { |
| 98 | 98 | return $field instanceof Ckeditor; |
| 99 | 99 | } |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | ], |
| 94 | 94 | ]; |
| 95 | 95 | |
| 96 | - array_walk($dependencies, function ($package, $provider) { |
|
| 96 | + array_walk($dependencies, function($package, $provider) { |
|
| 97 | 97 | if (is_string($package) && is_numeric($provider)) { |
| 98 | 98 | $provider = $package; |
| 99 | 99 | $package = null; |
@@ -167,8 +167,8 @@ |
||
| 167 | 167 | $searchable = $request->get('searchable', User::class); |
| 168 | 168 | $searchTerm = $request->get('query'); |
| 169 | 169 | $instance = (new $searchable)->where('id', (int) $searchTerm) |
| 170 | - ->orWhere('name', 'LIKE', "%{$request->get('query')}%") |
|
| 171 | - ->get(['id', 'name']); |
|
| 170 | + ->orWhere('name', 'LIKE', "%{$request->get('query')}%") |
|
| 171 | + ->get(['id', 'name']); |
|
| 172 | 172 | |
| 173 | 173 | return response()->json(['items' => $instance->toArray()]); |
| 174 | 174 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | $files = $this->storage |
| 57 | 57 | ->files($directory) |
| 58 | - ->when($popup, function ($files) { |
|
| 58 | + ->when($popup, function($files) { |
|
| 59 | 59 | return $files->filter->isImage(); |
| 60 | 60 | }) |
| 61 | 61 | ->merge($this->storage->directories($directory)); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | public function move(Request $request) |
| 92 | 92 | { |
| 93 | 93 | $target = $request->get('target'); |
| 94 | - $files = array_filter($request->get('files'), function ($file) use ($target) { |
|
| 94 | + $files = array_filter($request->get('files'), function($file) use ($target) { |
|
| 95 | 95 | return $file !== $target; |
| 96 | 96 | }); |
| 97 | 97 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | // remove storage path from $directory |
| 149 | 149 | $directory = implode('/', array_slice(explode('/', $directory), 1)); |
| 150 | 150 | |
| 151 | - $this->breadcrumbs->register('index', function (Generator $generator) use ($popup) { |
|
| 151 | + $this->breadcrumbs->register('index', function(Generator $generator) use ($popup) { |
|
| 152 | 152 | $generator->push('Home', route('scaffold.media'.($popup ? '.popup' : ''))); |
| 153 | 153 | }); |
| 154 | 154 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | foreach ($dirs as $index => $dir) { |
| 160 | 160 | $tmpPath = $path; |
| 161 | 161 | $path[] = $dir; |
| 162 | - $this->breadcrumbs->register($section = implode('.', $path), function (Generator $generator) use (&$parent, $dir, $tmpPath, $dirs) { |
|
| 162 | + $this->breadcrumbs->register($section = implode('.', $path), function(Generator $generator) use (&$parent, $dir, $tmpPath, $dirs) { |
|
| 163 | 163 | $generator->parent($parent = implode('.', $tmpPath)); |
| 164 | 164 | $generator->push($dir, route('scaffold.media', ['path' => implode('/', array_slice($dirs, 0, -1))])); |
| 165 | 165 | }); |