@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function canShow() |
40 | 40 | { |
41 | - if (is_null($this->getModel()->getKey()) || ! $this->show) { |
|
41 | + if (is_null($this->getModel()->getKey()) || !$this->show) { |
|
42 | 42 | return false; |
43 | 43 | } |
44 | 44 |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | |
55 | 55 | $admin->navigation()->setCurrentUrl($request->getUri()); |
56 | 56 | |
57 | - if (! $this->breadcrumbs->exists('home')) { |
|
58 | - $this->breadcrumbs->register('home', function ($breadcrumbs) { |
|
57 | + if (!$this->breadcrumbs->exists('home')) { |
|
58 | + $this->breadcrumbs->register('home', function($breadcrumbs) { |
|
59 | 59 | $breadcrumbs->push(trans('sleeping_owl::lang.dashboard'), route('admin.dashboard')); |
60 | 60 | }); |
61 | 61 | } |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | foreach ($breadcrumbs as $breadcrumb) { |
79 | - if (! $this->breadcrumbs->exists($breadcrumb['id'])) { |
|
80 | - $this->breadcrumbs->register($breadcrumb['id'], function ($breadcrumbs) use ($breadcrumb) { |
|
79 | + if (!$this->breadcrumbs->exists($breadcrumb['id'])) { |
|
80 | + $this->breadcrumbs->register($breadcrumb['id'], function($breadcrumbs) use ($breadcrumb) { |
|
81 | 81 | $breadcrumbs->parent($breadcrumb['parent']); |
82 | 82 | $breadcrumbs->push($breadcrumb['title'], $breadcrumb['url']); |
83 | 83 | }); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function getDisplay(ModelConfigurationInterface $model) |
123 | 123 | { |
124 | - if (! $model->isDisplayable()) { |
|
124 | + if (!$model->isDisplayable()) { |
|
125 | 125 | abort(404); |
126 | 126 | } |
127 | 127 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function getCreate(ModelConfigurationInterface $model) |
139 | 139 | { |
140 | - if (! $model->isCreatable()) { |
|
140 | + if (!$model->isCreatable()) { |
|
141 | 141 | abort(404); |
142 | 142 | } |
143 | 143 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public function postStore(ModelConfigurationInterface $model, Request $request) |
158 | 158 | { |
159 | - if (! $model->isCreatable()) { |
|
159 | + if (!$model->isCreatable()) { |
|
160 | 160 | abort(404); |
161 | 161 | } |
162 | 162 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $redirectPolicy = $model->getRedirect(); |
195 | 195 | |
196 | 196 | /* Make redirect when use in model config && Fix editable redirect */ |
197 | - if ($redirectPolicy->get('create') == 'display' || ! $model->isEditable($newModel)) { |
|
197 | + if ($redirectPolicy->get('create') == 'display' || !$model->isEditable($newModel)) { |
|
198 | 198 | $redirectUrl = $model->getDisplayUrl(); |
199 | 199 | } |
200 | 200 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | { |
234 | 234 | $item = $model->getRepository()->find($id); |
235 | 235 | |
236 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
236 | + if (is_null($item) || !$model->isEditable($item)) { |
|
237 | 237 | abort(404); |
238 | 238 | } |
239 | 239 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $editForm = $model->fireEdit($id); |
258 | 258 | $item = $editForm->getModel(); |
259 | 259 | |
260 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
260 | + if (is_null($item) || !$model->isEditable($item)) { |
|
261 | 261 | abort(404); |
262 | 262 | } |
263 | 263 | |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | |
337 | 337 | /* @var ColumnEditableInterface|null $column */ |
338 | 338 | if (is_callable([$display, 'getColumns'])) { |
339 | - $column = $display->getColumns()->all()->filter(function ($column) use ($field) { |
|
339 | + $column = $display->getColumns()->all()->filter(function($column) use ($field) { |
|
340 | 340 | return ($column instanceof ColumnEditableInterface) and $field == $column->getName(); |
341 | 341 | })->first(); |
342 | 342 | } else { |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | $content = $tab->getContent(); |
346 | 346 | |
347 | 347 | if ($content instanceof DisplayTable) { |
348 | - $column = $content->getColumns()->all()->filter(function ($column) use ($field) { |
|
348 | + $column = $content->getColumns()->all()->filter(function($column) use ($field) { |
|
349 | 349 | return ($column instanceof ColumnEditableInterface) and $field == $column->getName(); |
350 | 350 | })->first(); |
351 | 351 | } |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | |
355 | 355 | //Return data-table if inside FormElements |
356 | 356 | if ($element instanceof DisplayTable) { |
357 | - $column = $element->getColumns()->all()->filter(function ($column) use ($field) { |
|
357 | + $column = $element->getColumns()->all()->filter(function($column) use ($field) { |
|
358 | 358 | return ($column instanceof ColumnEditableInterface) and $field == $column->getName(); |
359 | 359 | })->first(); |
360 | 360 | } |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | if ($element instanceof Column) { |
364 | 364 | foreach ($element->getElements() as $columnElement) { |
365 | 365 | if ($columnElement instanceof DisplayTable) { |
366 | - $column = $columnElement->getColumns()->all()->filter(function ($column) use ($field) { |
|
366 | + $column = $columnElement->getColumns()->all()->filter(function($column) use ($field) { |
|
367 | 367 | return ($column instanceof ColumnEditableInterface) and $field == $column->getName(); |
368 | 368 | })->first(); |
369 | 369 | } |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | $repository = $model->getRepository(); |
383 | 383 | $item = $repository->find($id); |
384 | 384 | |
385 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
385 | + if (is_null($item) || !$model->isEditable($item)) { |
|
386 | 386 | abort(404); |
387 | 387 | } |
388 | 388 | |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | { |
410 | 410 | $item = $model->getRepository()->find($id); |
411 | 411 | |
412 | - if (is_null($item) || ! $model->isDeletable($item)) { |
|
412 | + if (is_null($item) || !$model->isDeletable($item)) { |
|
413 | 413 | abort(404); |
414 | 414 | } |
415 | 415 | |
@@ -438,13 +438,13 @@ discard block |
||
438 | 438 | */ |
439 | 439 | public function deleteDestroy(ModelConfigurationInterface $model, Request $request, $id) |
440 | 440 | { |
441 | - if (! $model->isRestorableModel()) { |
|
441 | + if (!$model->isRestorableModel()) { |
|
442 | 442 | abort(404); |
443 | 443 | } |
444 | 444 | |
445 | 445 | $item = $model->getRepository()->findOnlyTrashed($id); |
446 | 446 | |
447 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
447 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
448 | 448 | abort(404); |
449 | 449 | } |
450 | 450 | |
@@ -473,13 +473,13 @@ discard block |
||
473 | 473 | */ |
474 | 474 | public function postRestore(ModelConfigurationInterface $model, Request $request, $id) |
475 | 475 | { |
476 | - if (! $model->isRestorableModel()) { |
|
476 | + if (!$model->isRestorableModel()) { |
|
477 | 477 | abort(404); |
478 | 478 | } |
479 | 479 | |
480 | 480 | $item = $model->getRepository()->findOnlyTrashed($id); |
481 | 481 | |
482 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
482 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
483 | 483 | abort(404); |
484 | 484 | } |
485 | 485 | |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | */ |
565 | 565 | protected function registerBreadcrumb($title, $parent) |
566 | 566 | { |
567 | - $this->breadcrumbs->register('render', function ($breadcrumbs) use ($title, $parent) { |
|
567 | + $this->breadcrumbs->register('render', function($breadcrumbs) use ($title, $parent) { |
|
568 | 568 | $breadcrumbs->parent($parent); |
569 | 569 | $breadcrumbs->push($title); |
570 | 570 | }); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public static function registerRoutes(Router $router) |
24 | 24 | { |
25 | 25 | $routeName = 'admin.display.tree.reorder'; |
26 | - if (! $router->has($routeName)) { |
|
26 | + if (!$router->has($routeName)) { |
|
27 | 27 | $router->post('{adminModel}/reorder', |
28 | 28 | ['as' => $routeName, 'uses' => 'SleepingOwl\Admin\Http\Controllers\DisplayController@treeReorder']); |
29 | 29 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | if ($this->getParentField()) { |
119 | 119 | $repository = $repository->setParentField($this->getParentField()); |
120 | 120 | } |
121 | - if (! is_null($this->treeType)) { |
|
121 | + if (!is_null($this->treeType)) { |
|
122 | 122 | $repository->setTreeType($this->treeType); |
123 | 123 | } |
124 | 124 | |
@@ -340,11 +340,11 @@ discard block |
||
340 | 340 | */ |
341 | 341 | public function getCollection() |
342 | 342 | { |
343 | - if (! $this->isInitialized()) { |
|
343 | + if (!$this->isInitialized()) { |
|
344 | 344 | throw new \Exception('Display is not initialized'); |
345 | 345 | } |
346 | 346 | |
347 | - if (! is_null($this->collection)) { |
|
347 | + if (!is_null($this->collection)) { |
|
348 | 348 | return $this->collection; |
349 | 349 | } |
350 | 350 | |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | { |
376 | 376 | $repository = parent::makeRepository(); |
377 | 377 | |
378 | - if (! ($repository instanceof TreeRepositoryInterface)) { |
|
378 | + if (!($repository instanceof TreeRepositoryInterface)) { |
|
379 | 379 | throw new \Exception('Repository class must be instanced of [TreeRepositoryInterface]'); |
380 | 380 | } |
381 | 381 |
@@ -74,15 +74,15 @@ |
||
74 | 74 | { |
75 | 75 | $this->content = $content; |
76 | 76 | |
77 | - if (! is_null($label)) { |
|
77 | + if (!is_null($label)) { |
|
78 | 78 | $this->setLabel($label); |
79 | 79 | } |
80 | 80 | |
81 | - if (! is_null($icon)) { |
|
81 | + if (!is_null($icon)) { |
|
82 | 82 | $this->setIcon($icon); |
83 | 83 | } |
84 | 84 | |
85 | - if (! is_null($badge)) { |
|
85 | + if (!is_null($badge)) { |
|
86 | 86 | $this->setBadge($badge); |
87 | 87 | } |
88 | 88 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | - $activeTabs = $this->getTabs()->filter(function (TabInterface $tab) { |
|
70 | + $activeTabs = $this->getTabs()->filter(function(TabInterface $tab) { |
|
71 | 71 | return $tab->isActive(); |
72 | 72 | })->count(); |
73 | 73 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function setModelClass($class) |
97 | 97 | { |
98 | - $this->getTabs()->each(function (TabInterface $tab) use ($class) { |
|
98 | + $this->getTabs()->each(function(TabInterface $tab) use ($class) { |
|
99 | 99 | if ($tab instanceof DisplayInterface) { |
100 | 100 | $tab->setModelClass($class); |
101 | 101 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public function setAction($action) |
181 | 181 | { |
182 | - $this->getTabs()->each(function (TabInterface $tab) use ($action) { |
|
182 | + $this->getTabs()->each(function(TabInterface $tab) use ($action) { |
|
183 | 183 | if ($tab instanceof FormInterface) { |
184 | 184 | $tab->setAction($action); |
185 | 185 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function setId($id) |
197 | 197 | { |
198 | - $this->getTabs()->each(function (TabInterface $tab) use ($id) { |
|
198 | + $this->getTabs()->each(function(TabInterface $tab) use ($id) { |
|
199 | 199 | if ($tab instanceof FormInterface) { |
200 | 200 | $tab->setId($id); |
201 | 201 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function validateForm(\Illuminate\Http\Request $request, ModelConfigurationInterface $model = null) |
214 | 214 | { |
215 | - $this->getTabs()->each(function ($tab) use ($request, $model) { |
|
215 | + $this->getTabs()->each(function($tab) use ($request, $model) { |
|
216 | 216 | $tabId = $request->get('sleeping_owl_tab_id'); |
217 | 217 | |
218 | 218 | if ($tab instanceof FormInterface && $tab->getName() == $tabId) { |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | */ |
230 | 230 | public function saveForm(\Illuminate\Http\Request $request, ModelConfigurationInterface $model = null) |
231 | 231 | { |
232 | - $this->getTabs()->each(function (TabInterface $tab) use ($request, $model) { |
|
232 | + $this->getTabs()->each(function(TabInterface $tab) use ($request, $model) { |
|
233 | 233 | $tabId = $request->get('sleeping_owl_tab_id'); |
234 | 234 | |
235 | 235 | if ($tab instanceof FormInterface && $tab->getName() == $tabId) { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public static function registerRoutes(Router $router) |
27 | 27 | { |
28 | 28 | $routeName = 'admin.display.async'; |
29 | - if (! $router->has($routeName)) { |
|
29 | + if (!$router->has($routeName)) { |
|
30 | 30 | $router->get('{adminModel}/async/{adminDisplayName?}', [ |
31 | 31 | 'as' => $routeName, |
32 | 32 | 'uses' => 'SleepingOwl\Admin\Http\Controllers\DisplayController@async', |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | $routeName = 'admin.display.async.inlineEdit'; |
37 | - if (! $router->has($routeName)) { |
|
37 | + if (!$router->has($routeName)) { |
|
38 | 38 | $router->post('{adminModel}/async/{adminDisplayName?}', [ |
39 | 39 | 'as' => $routeName, |
40 | 40 | 'uses' => 'SleepingOwl\Admin\Http\Controllers\AdminController@inlineEdit', |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $totalCount = $query->count(); |
176 | 176 | $filteredCount = 0; |
177 | 177 | |
178 | - if (! is_null($this->distinct)) { |
|
178 | + if (!is_null($this->distinct)) { |
|
179 | 179 | $filteredCount = $query->distinct()->count($this->getDistinct()); |
180 | 180 | } |
181 | 181 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | return; |
224 | 224 | } |
225 | 225 | |
226 | - $query->where(function ($query) use ($search) { |
|
226 | + $query->where(function($query) use ($search) { |
|
227 | 227 | $columns = $this->getColumns()->all(); |
228 | 228 | |
229 | 229 | foreach ($columns as $column) { |