@@ -59,7 +59,7 @@ |
||
59 | 59 | $display = $model->fireDisplay(); |
60 | 60 | |
61 | 61 | if ($display instanceof DisplayTabbed) { |
62 | - $display->getTabs()->each(function ($tab) use ($request) { |
|
62 | + $display->getTabs()->each(function($tab) use ($request) { |
|
63 | 63 | $content = $tab->getContent(); |
64 | 64 | if ($content instanceof DisplayTree) { |
65 | 65 | $content->getRepository()->reorder( |
@@ -24,12 +24,12 @@ |
||
24 | 24 | collect([ |
25 | 25 | Installation\PublishAssets::class, |
26 | 26 | ]) |
27 | - ->map(function ($installer) { |
|
27 | + ->map(function($installer) { |
|
28 | 28 | return new $installer($this, $this->config); |
29 | 29 | }) |
30 | - ->filter(function ($installer) { |
|
31 | - return $this->hasOption('force') ? true : ! $installer->installed(); |
|
32 | - })->each(function ($installer) { |
|
30 | + ->filter(function($installer) { |
|
31 | + return $this->hasOption('force') ? true : !$installer->installed(); |
|
32 | + })->each(function($installer) { |
|
33 | 33 | $installer->install(); |
34 | 34 | $installer->showInfo(); |
35 | 35 | }); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | { |
27 | 27 | parent::__construct($path, $label, $options); |
28 | 28 | |
29 | - $this->setLoadOptionsQueryPreparer(function ($item, $query) { |
|
29 | + $this->setLoadOptionsQueryPreparer(function($item, $query) { |
|
30 | 30 | $repository = app(RepositoryInterface::class); |
31 | 31 | $repository->setModel($this->getModelForOptions()); |
32 | 32 | $key = $repository->getModel()->getKeyName(); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | { |
76 | 76 | $routeName = 'admin.form.element.'.static::$route; |
77 | 77 | |
78 | - if (! $router->has($routeName)) { |
|
78 | + if (!$router->has($routeName)) { |
|
79 | 79 | $router->post('{adminModel}/'.static::$route.'/{field}/{id?}', [ |
80 | 80 | 'as' => $routeName, |
81 | 81 | 'uses' => 'SleepingOwl\Admin\Http\Controllers\FormElementController@multiselectSearch', |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | $attribute = $this->getModelAttributeKey(); |
111 | 111 | |
112 | - if (! method_exists($this->getModel(), $attribute)) { |
|
112 | + if (!method_exists($this->getModel(), $attribute)) { |
|
113 | 113 | return; |
114 | 114 | } |
115 | 115 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | { |
24 | 24 | parent::__construct($path, $label); |
25 | 25 | |
26 | - $this->setLoadOptionsQueryPreparer(function ($item, $query) { |
|
26 | + $this->setLoadOptionsQueryPreparer(function($item, $query) { |
|
27 | 27 | $repository = app(RepositoryInterface::class); |
28 | 28 | $repository->setModel($this->getModelForOptions()); |
29 | 29 | $key = $repository->getModel()->getKeyName(); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | $routeName = 'admin.form.element.'.static::$route; |
41 | 41 | |
42 | - if (! $router->has($routeName)) { |
|
42 | + if (!$router->has($routeName)) { |
|
43 | 43 | $router->post('{adminModel}/'.static::$route.'/{field}/{id?}', [ |
44 | 44 | 'as' => $routeName, |
45 | 45 | 'uses' => 'SleepingOwl\Admin\Http\Controllers\FormElementController@selectSearch', |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | $routeName = 'admin.form.element.'.static::$route; |
29 | 29 | |
30 | - if (! $router->has($routeName)) { |
|
30 | + if (!$router->has($routeName)) { |
|
31 | 31 | $router->post('{adminModel}/'.static::$route.'/{field}/{id?}', [ |
32 | 32 | 'as' => $routeName, |
33 | 33 | 'uses' => 'SleepingOwl\Admin\Http\Controllers\UploadController@fromField', |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function getUploadPath(UploadedFile $file) |
129 | 129 | { |
130 | - if (! is_callable($this->uploadPath)) { |
|
130 | + if (!is_callable($this->uploadPath)) { |
|
131 | 131 | return $this->defaultUploadPath($file); |
132 | 132 | } |
133 | 133 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function getUploadFileName(UploadedFile $file) |
155 | 155 | { |
156 | - if (! is_callable($this->uploadFileName)) { |
|
156 | + if (!is_callable($this->uploadFileName)) { |
|
157 | 157 | return $this->defaultUploadFilename($file); |
158 | 158 | } |
159 | 159 |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | { |
83 | 83 | $name = array_shift($parts); |
84 | 84 | |
85 | - while (! empty($parts)) { |
|
85 | + while (!empty($parts)) { |
|
86 | 86 | $part = array_shift($parts); |
87 | 87 | $name .= "[$part]"; |
88 | 88 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | { |
236 | 236 | $this->addValidationRule('_unique'); |
237 | 237 | |
238 | - if (! is_null($message)) { |
|
238 | + if (!is_null($message)) { |
|
239 | 239 | $this->addValidationMessage('unique', $message); |
240 | 240 | } |
241 | 241 | |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | */ |
344 | 344 | public function getValueFromRequest(\Illuminate\Http\Request $request) |
345 | 345 | { |
346 | - if ($request->hasSession() && ! is_null($value = $request->old($this->getPath()))) { |
|
346 | + if ($request->hasSession() && !is_null($value = $request->old($this->getPath()))) { |
|
347 | 347 | return $value; |
348 | 348 | } |
349 | 349 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | */ |
356 | 356 | public function getValueFromModel() |
357 | 357 | { |
358 | - if (! is_null($value = $this->getValueFromRequest(request()))) { |
|
358 | + if (!is_null($value = $this->getValueFromRequest(request()))) { |
|
359 | 359 | return $value; |
360 | 360 | } |
361 | 361 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | $path = $this->getPath(); |
364 | 364 | $value = $this->getDefaultValue(); |
365 | 365 | |
366 | - if (is_null($model) or ! $model->exists) { |
|
366 | + if (is_null($model) or !$model->exists) { |
|
367 | 367 | return $value; |
368 | 368 | } |
369 | 369 | |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | if ($count === 1) { |
374 | 374 | $attribute = $model->getAttribute($this->getModelAttributeKey()); |
375 | 375 | |
376 | - if (! empty($attribute) or is_null($value)) { |
|
376 | + if (!empty($attribute) or is_null($value)) { |
|
377 | 377 | return $attribute; |
378 | 378 | } |
379 | 379 | } |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | if ($count === 2) { |
388 | 388 | $attribute = $model->getAttribute($relation); |
389 | 389 | |
390 | - if (! empty($attribute) or is_null($value)) { |
|
390 | + if (!empty($attribute) or is_null($value)) { |
|
391 | 391 | return $attribute; |
392 | 392 | } |
393 | 393 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function can($action, Model $model) |
205 | 205 | { |
206 | - if (! $this->checkAccess) { |
|
206 | + if (!$this->checkAccess) { |
|
207 | 207 | return true; |
208 | 208 | } |
209 | 209 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public function isCreatable() |
217 | 217 | { |
218 | - if (! is_callable($this->getCreate())) { |
|
218 | + if (!is_callable($this->getCreate())) { |
|
219 | 219 | return false; |
220 | 220 | } |
221 | 221 | |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | */ |
240 | 240 | public function isEditable(Model $model) |
241 | 241 | { |
242 | - if (! is_callable($this->getEdit())) { |
|
242 | + if (!is_callable($this->getEdit())) { |
|
243 | 243 | return false; |
244 | 244 | } |
245 | 245 | |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | */ |
362 | 362 | public function fireDisplay() |
363 | 363 | { |
364 | - if (! is_callable($this->getDisplay())) { |
|
364 | + if (!is_callable($this->getDisplay())) { |
|
365 | 365 | return; |
366 | 366 | } |
367 | 367 | |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | */ |
403 | 403 | public function fireCreate() |
404 | 404 | { |
405 | - if (! is_callable($this->getCreate())) { |
|
405 | + if (!is_callable($this->getCreate())) { |
|
406 | 406 | return; |
407 | 407 | } |
408 | 408 | |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | */ |
450 | 450 | public function fireEdit($id) |
451 | 451 | { |
452 | - if (! is_callable($this->getEdit())) { |
|
452 | + if (!is_callable($this->getEdit())) { |
|
453 | 453 | return; |
454 | 454 | } |
455 | 455 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | protected function registerModelBindings(Collection $aliases) |
60 | 60 | { |
61 | - $this->router->bind('adminModel', function ($model, Route $route) use ($aliases) { |
|
61 | + $this->router->bind('adminModel', function($model, Route $route) use ($aliases) { |
|
62 | 62 | if (is_null($model = $aliases->get($model))) { |
63 | 63 | throw new ModelNotFoundException(); |
64 | 64 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | protected function runCustomController(Route $route, $controller, $action) |
81 | 81 | { |
82 | - $route->uses(function () use ($route, $controller, $action) { |
|
82 | + $route->uses(function() use ($route, $controller, $action) { |
|
83 | 83 | return (new \Illuminate\Routing\ControllerDispatcher($this->app))->dispatch( |
84 | 84 | $route, $this->app->make($controller), $action |
85 | 85 | ); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public static function registerRoutes(Router $router) |
23 | 23 | { |
24 | 24 | $routeName = 'admin.display.tree.reorder'; |
25 | - if (! $router->has($routeName)) { |
|
25 | + if (!$router->has($routeName)) { |
|
26 | 26 | $router->post('{adminModel}/reorder', ['as' => $routeName, 'uses' => 'SleepingOwl\Admin\Http\Controllers\DisplayController@treeReorder']); |
27 | 27 | } |
28 | 28 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ->setOrderField($this->getOrderField()) |
111 | 111 | ->setRootParentId($this->getRootParentId()); |
112 | 112 | |
113 | - if (! is_null($this->treeType)) { |
|
113 | + if (!is_null($this->treeType)) { |
|
114 | 114 | $repository->setTreeType($this->treeType); |
115 | 115 | } |
116 | 116 | } |
@@ -305,11 +305,11 @@ discard block |
||
305 | 305 | */ |
306 | 306 | public function getCollection() |
307 | 307 | { |
308 | - if (! $this->isInitialized()) { |
|
308 | + if (!$this->isInitialized()) { |
|
309 | 309 | throw new \Exception('Display is not initialized'); |
310 | 310 | } |
311 | 311 | |
312 | - if (! is_null($this->collection)) { |
|
312 | + if (!is_null($this->collection)) { |
|
313 | 313 | return $this->collection; |
314 | 314 | } |
315 | 315 | |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | { |
341 | 341 | $repository = parent::makeRepository(); |
342 | 342 | |
343 | - if (! ($repository instanceof TreeRepositoryInterface)) { |
|
343 | + if (!($repository instanceof TreeRepositoryInterface)) { |
|
344 | 344 | throw new \Exception('Repository class must be instanced of [TreeRepositoryInterface]'); |
345 | 345 | } |
346 | 346 |