@@ -39,35 +39,35 @@ discard block |
||
39 | 39 | public function __construct(Request $request, \Illuminate\Contracts\Foundation\Application $application) |
40 | 40 | { |
41 | 41 | $this->application = $application; |
42 | - $this->navigation = $application['sleeping_owl.navigation']; |
|
42 | + $this->navigation = $application[ 'sleeping_owl.navigation' ]; |
|
43 | 43 | $this->navigation->setCurrentUrl($request->url()); |
44 | 44 | |
45 | - if (! Breadcrumbs::exists('home')) { |
|
46 | - Breadcrumbs::register('home', function ($breadcrumbs) { |
|
45 | + if (!Breadcrumbs::exists('home')) { |
|
46 | + Breadcrumbs::register('home', function($breadcrumbs) { |
|
47 | 47 | $breadcrumbs->push(trans('sleeping_owl::lang.dashboard'), route('admin.dashboard')); |
48 | 48 | }); |
49 | 49 | } |
50 | 50 | |
51 | - $breadcrumbs = []; |
|
51 | + $breadcrumbs = [ ]; |
|
52 | 52 | |
53 | 53 | if ($currentPage = $this->navigation->getCurrentPage()) { |
54 | 54 | foreach ($currentPage->getPathArray() as $page) { |
55 | - $breadcrumbs[] = [ |
|
56 | - 'id' => $page['id'], |
|
57 | - 'title' => $page['title'], |
|
58 | - 'url' => $page['url'], |
|
55 | + $breadcrumbs[ ] = [ |
|
56 | + 'id' => $page[ 'id' ], |
|
57 | + 'title' => $page[ 'title' ], |
|
58 | + 'url' => $page[ 'url' ], |
|
59 | 59 | 'parent' => $this->parentBreadcrumb, |
60 | 60 | ]; |
61 | 61 | |
62 | - $this->parentBreadcrumb = $page['id']; |
|
62 | + $this->parentBreadcrumb = $page[ 'id' ]; |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | 66 | foreach ($breadcrumbs as $breadcrumb) { |
67 | - if (! Breadcrumbs::exists($breadcrumb['id'])) { |
|
68 | - Breadcrumbs::register($breadcrumb['id'], function ($breadcrumbs) use ($breadcrumb) { |
|
69 | - $breadcrumbs->parent($breadcrumb['parent']); |
|
70 | - $breadcrumbs->push($breadcrumb['title'], $breadcrumb['url']); |
|
67 | + if (!Breadcrumbs::exists($breadcrumb[ 'id' ])) { |
|
68 | + Breadcrumbs::register($breadcrumb[ 'id' ], function($breadcrumbs) use ($breadcrumb) { |
|
69 | + $breadcrumbs->parent($breadcrumb[ 'parent' ]); |
|
70 | + $breadcrumbs->push($breadcrumb[ 'title' ], $breadcrumb[ 'url' ]); |
|
71 | 71 | }); |
72 | 72 | } |
73 | 73 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function getDisplay(ModelConfigurationInterface $model) |
109 | 109 | { |
110 | - if (! $model->isDisplayable()) { |
|
110 | + if (!$model->isDisplayable()) { |
|
111 | 111 | abort(404); |
112 | 112 | } |
113 | 113 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function getCreate(ModelConfigurationInterface $model) |
123 | 123 | { |
124 | - if (! $model->isCreatable()) { |
|
124 | + if (!$model->isCreatable()) { |
|
125 | 125 | abort(404); |
126 | 126 | } |
127 | 127 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function postStore(ModelConfigurationInterface $model, Request $request) |
141 | 141 | { |
142 | - if (! $model->isCreatable()) { |
|
142 | + if (!$model->isCreatable()) { |
|
143 | 143 | abort(404); |
144 | 144 | } |
145 | 145 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $redirectPolicy = $model->getRedirect(); |
174 | 174 | |
175 | 175 | /* Make redirect when use in model config && Fix editable redirect */ |
176 | - if ($redirectPolicy->get('create') == 'display' || ! $model->isEditable($newModel)) { |
|
176 | + if ($redirectPolicy->get('create') == 'display' || !$model->isEditable($newModel)) { |
|
177 | 177 | $redirectUrl = $model->getDisplayUrl(); |
178 | 178 | } |
179 | 179 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | { |
209 | 209 | $item = $model->getRepository()->find($id); |
210 | 210 | |
211 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
211 | + if (is_null($item) || !$model->isEditable($item)) { |
|
212 | 212 | abort(404); |
213 | 213 | } |
214 | 214 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $editForm = $model->fireEdit($id); |
231 | 231 | $item = $editForm->getModel(); |
232 | 232 | |
233 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
233 | + if (is_null($item) || !$model->isEditable($item)) { |
|
234 | 234 | abort(404); |
235 | 235 | } |
236 | 236 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | $display = $model->fireDisplay(); |
300 | 300 | |
301 | 301 | /** @var ColumnEditableInterface|null $column */ |
302 | - $column = $display->getColumns()->all()->filter(function ($column) use ($field) { |
|
302 | + $column = $display->getColumns()->all()->filter(function($column) use ($field) { |
|
303 | 303 | return ($column instanceof ColumnEditableInterface) and $field == $column->getName(); |
304 | 304 | })->first(); |
305 | 305 | |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | $repository = $model->getRepository(); |
311 | 311 | $item = $repository->find($id); |
312 | 312 | |
313 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
313 | + if (is_null($item) || !$model->isEditable($item)) { |
|
314 | 314 | abort(404); |
315 | 315 | } |
316 | 316 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | { |
336 | 336 | $item = $model->getRepository()->find($id); |
337 | 337 | |
338 | - if (is_null($item) || ! $model->isDeletable($item)) { |
|
338 | + if (is_null($item) || !$model->isDeletable($item)) { |
|
339 | 339 | abort(404); |
340 | 340 | } |
341 | 341 | |
@@ -362,13 +362,13 @@ discard block |
||
362 | 362 | */ |
363 | 363 | public function deleteDestroy(ModelConfigurationInterface $model, Request $request, $id) |
364 | 364 | { |
365 | - if (! $model->isRestorableModel()) { |
|
365 | + if (!$model->isRestorableModel()) { |
|
366 | 366 | abort(404); |
367 | 367 | } |
368 | 368 | |
369 | 369 | $item = $model->getRepository()->findOnlyTrashed($id); |
370 | 370 | |
371 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
371 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
372 | 372 | abort(404); |
373 | 373 | } |
374 | 374 | |
@@ -395,13 +395,13 @@ discard block |
||
395 | 395 | */ |
396 | 396 | public function postRestore(ModelConfigurationInterface $model, Request $request, $id) |
397 | 397 | { |
398 | - if (! $model->isRestorableModel()) { |
|
398 | + if (!$model->isRestorableModel()) { |
|
399 | 399 | abort(404); |
400 | 400 | } |
401 | 401 | |
402 | 402 | $item = $model->getRepository()->findOnlyTrashed($id); |
403 | 403 | |
404 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
404 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
405 | 405 | abort(404); |
406 | 406 | } |
407 | 407 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | { |
468 | 468 | $lang = trans('sleeping_owl::lang'); |
469 | 469 | if ($lang == 'sleeping_owl::lang') { |
470 | - $lang = trans('sleeping_owl::lang', [], 'messages', 'en'); |
|
470 | + $lang = trans('sleeping_owl::lang', [ ], 'messages', 'en'); |
|
471 | 471 | } |
472 | 472 | |
473 | 473 | $data = [ |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | { |
511 | 511 | if (($backUrl = $request->input('_redirectBack')) == \URL::previous()) { |
512 | 512 | $backUrl = null; |
513 | - $request->merge(['_redirectBack' => $backUrl]); |
|
513 | + $request->merge([ '_redirectBack' => $backUrl ]); |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | return $backUrl; |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | */ |
528 | 528 | protected function registerBreadcrumb($title, $parent) |
529 | 529 | { |
530 | - Breadcrumbs::register('render', function ($breadcrumbs) use ($title, $parent) { |
|
530 | + Breadcrumbs::register('render', function($breadcrumbs) use ($title, $parent) { |
|
531 | 531 | $breadcrumbs->parent($parent); |
532 | 532 | $breadcrumbs->push($title); |
533 | 533 | }); |
@@ -22,7 +22,7 @@ |
||
22 | 22 | @foreach ($columns as $column) |
23 | 23 | <?php |
24 | 24 | $column->setModel($model); |
25 | - if($column instanceof \SleepingOwl\Admin\Display\Column\Control) { |
|
25 | + if ($column instanceof \SleepingOwl\Admin\Display\Column\Control) { |
|
26 | 26 | $column->initialize(); |
27 | 27 | } |
28 | 28 | ?> |