@@ -101,7 +101,7 @@ |
||
| 101 | 101 | */ |
| 102 | 102 | public function assetPath($path = null) |
| 103 | 103 | { |
| 104 | - return ! is_null($path) ? $this->assetDir().'/'.ltrim($path, '/') : $this->assetDir(); |
|
| 104 | + return !is_null($path) ? $this->assetDir().'/'.ltrim($path, '/') : $this->assetDir(); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | */ |
| 205 | 205 | public function can($action, Model $model) |
| 206 | 206 | { |
| 207 | - if (! $this->checkAccess) { |
|
| 207 | + if (!$this->checkAccess) { |
|
| 208 | 208 | return true; |
| 209 | 209 | } |
| 210 | 210 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | public function isCreatable() |
| 218 | 218 | { |
| 219 | - if (! is_callable($this->getCreate())) { |
|
| 219 | + if (!is_callable($this->getCreate())) { |
|
| 220 | 220 | return false; |
| 221 | 221 | } |
| 222 | 222 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | public function isEditable(Model $model) |
| 242 | 242 | { |
| 243 | - if (! is_callable($this->getEdit())) { |
|
| 243 | + if (!is_callable($this->getEdit())) { |
|
| 244 | 244 | return false; |
| 245 | 245 | } |
| 246 | 246 | |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | */ |
| 364 | 364 | public function fireDisplay(array $payload = []) |
| 365 | 365 | { |
| 366 | - if (! is_callable($this->getDisplay())) { |
|
| 366 | + if (!is_callable($this->getDisplay())) { |
|
| 367 | 367 | return; |
| 368 | 368 | } |
| 369 | 369 | |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | */ |
| 410 | 410 | public function fireCreate() |
| 411 | 411 | { |
| 412 | - if (! is_callable($this->getCreate())) { |
|
| 412 | + if (!is_callable($this->getCreate())) { |
|
| 413 | 413 | return; |
| 414 | 414 | } |
| 415 | 415 | |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | */ |
| 457 | 457 | public function fireEdit($id) |
| 458 | 458 | { |
| 459 | - if (! is_callable($this->getEdit())) { |
|
| 459 | + if (!is_callable($this->getEdit())) { |
|
| 460 | 460 | return; |
| 461 | 461 | } |
| 462 | 462 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function fireDisplay(array $payload = []) |
| 35 | 35 | { |
| 36 | - if (! method_exists($this, 'onDisplay')) { |
|
| 36 | + if (!method_exists($this, 'onDisplay')) { |
|
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function fireCreate() |
| 58 | 58 | { |
| 59 | - if (! method_exists($this, 'onCreate')) { |
|
| 59 | + if (!method_exists($this, 'onCreate')) { |
|
| 60 | 60 | return; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function fireEdit($id) |
| 85 | 85 | { |
| 86 | - if (! method_exists($this, 'onEdit')) { |
|
| 86 | + if (!method_exists($this, 'onEdit')) { |
|
| 87 | 87 | return; |
| 88 | 88 | } |
| 89 | 89 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | array $values |
| 185 | 185 | ) { |
| 186 | 186 | foreach ($values as $i => $value) { |
| 187 | - if (! array_key_exists($value, $this->getOptions()) and $this->isTaggable()) { |
|
| 187 | + if (!array_key_exists($value, $this->getOptions()) and $this->isTaggable()) { |
|
| 188 | 188 | $model = clone $this->getModelForOptions(); |
| 189 | 189 | $model->{$this->getDisplay()} = $value; |
| 190 | 190 | $model->save(); |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $items = $relation->get(); |
| 212 | 212 | |
| 213 | 213 | foreach ($items as $item) { |
| 214 | - if (! in_array($item->getKey(), $values)) { |
|
| 214 | + if (!in_array($item->getKey(), $values)) { |
|
| 215 | 215 | if ($this->isDeleteRelatedItem()) { |
| 216 | 216 | $item->delete(); |
| 217 | 217 | } else { |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $item = $model->find($value); |
| 237 | 237 | |
| 238 | 238 | if (is_null($item)) { |
| 239 | - if (! $this->isTaggable()) { |
|
| 239 | + if (!$this->isTaggable()) { |
|
| 240 | 240 | continue; |
| 241 | 241 | } |
| 242 | 242 | |
@@ -36,11 +36,11 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function canShow() |
| 38 | 38 | { |
| 39 | - if (is_null($this->getModel()->getKey()) || ! $this->show) { |
|
| 39 | + if (is_null($this->getModel()->getKey()) || !$this->show) { |
|
| 40 | 40 | return false; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - $this->show = ! $this->isTrashed() && $this->getModelConfiguration()->isDeletable($this->getModel()); |
|
| 43 | + $this->show = !$this->isTrashed() && $this->getModelConfiguration()->isDeletable($this->getModel()); |
|
| 44 | 44 | parent::canShow(); |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function canShow() |
| 38 | 38 | { |
| 39 | - if (is_null($this->getModel()->getKey()) || ! $this->show) { |
|
| 39 | + if (is_null($this->getModel()->getKey()) || !$this->show) { |
|
| 40 | 40 | return false; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -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 | }); |
@@ -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) { |