@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function getModelConfiguration() |
| 33 | 33 | { |
| 34 | - if (! $this->hasModel()) { |
|
| 34 | + if (!$this->hasModel()) { |
|
| 35 | 35 | return; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function hasModel() |
| 45 | 45 | { |
| 46 | - return ! is_null($this->model) and class_exists($this->model); |
|
| 46 | + return !is_null($this->model) and class_exists($this->model); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function getAccessLogic() |
| 85 | 85 | { |
| 86 | - if (! is_callable($this->accessLogic)) { |
|
| 86 | + if (!is_callable($this->accessLogic)) { |
|
| 87 | 87 | if ($this->hasModel()) { |
| 88 | - return function () { |
|
| 88 | + return function() { |
|
| 89 | 89 | return $this->getModelConfiguration()->isDisplayable(); |
| 90 | 90 | }; |
| 91 | 91 | } |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | public function render($view = null) |
| 103 | 103 | { |
| 104 | 104 | $data = $this->toArray(); |
| 105 | - $data['pages'] = $this->getPages(); |
|
| 105 | + $data[ 'pages' ] = $this->getPages(); |
|
| 106 | 106 | |
| 107 | - if (! is_null($view)) { |
|
| 107 | + if (!is_null($view)) { |
|
| 108 | 108 | return view($view, $data)->render(); |
| 109 | 109 | } |
| 110 | 110 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | |
| 39 | 39 | public function registerProviders() |
| 40 | 40 | { |
| 41 | - foreach (config('sleeping_owl.providers', []) as $providerClass) { |
|
| 41 | + foreach (config('sleeping_owl.providers', [ ]) as $providerClass) { |
|
| 42 | 42 | $this->app->register($providerClass); |
| 43 | 43 | } |
| 44 | 44 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | 'select' => \SleepingOwl\Admin\Display\Column\Filter\Select::class, |
| 28 | 28 | ]); |
| 29 | 29 | |
| 30 | - $this->app->singleton('sleeping_owl.column_filter', function () use ($alias) { |
|
| 30 | + $this->app->singleton('sleeping_owl.column_filter', function() use ($alias) { |
|
| 31 | 31 | return $alias; |
| 32 | 32 | }); |
| 33 | 33 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | 'tree' => \SleepingOwl\Admin\Display\DisplayTree::class, |
| 44 | 44 | ]); |
| 45 | 45 | |
| 46 | - $this->app->singleton('sleeping_owl.display', function () use ($alias) { |
|
| 46 | + $this->app->singleton('sleeping_owl.display', function() use ($alias) { |
|
| 47 | 47 | return $alias; |
| 48 | 48 | }); |
| 49 | 49 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | 'treeControl' => \SleepingOwl\Admin\Display\Column\TreeControl::class, |
| 69 | 69 | ]); |
| 70 | 70 | |
| 71 | - $this->app->singleton('sleeping_owl.table.column', function () use ($alias) { |
|
| 71 | + $this->app->singleton('sleeping_owl.table.column', function() use ($alias) { |
|
| 72 | 72 | return $alias; |
| 73 | 73 | }); |
| 74 | 74 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | 'checkbox' => \SleepingOwl\Admin\Display\Column\Editable\Checkbox::class, |
| 80 | 80 | ]); |
| 81 | 81 | |
| 82 | - $this->app->singleton('sleeping_owl.table.column.editable', function () use ($alias) { |
|
| 82 | + $this->app->singleton('sleeping_owl.table.column.editable', function() use ($alias) { |
|
| 83 | 83 | return $alias; |
| 84 | 84 | }); |
| 85 | 85 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | 'html' => \SleepingOwl\Admin\Form\Element\Html::class, |
| 112 | 112 | ]); |
| 113 | 113 | |
| 114 | - $this->app->singleton('sleeping_owl.form.element', function () use ($alias) { |
|
| 114 | + $this->app->singleton('sleeping_owl.form.element', function() use ($alias) { |
|
| 115 | 115 | return $alias; |
| 116 | 116 | }); |
| 117 | 117 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | 'panel' => \SleepingOwl\Admin\Form\FormPanel::class, |
| 125 | 125 | ]); |
| 126 | 126 | |
| 127 | - $this->app->singleton('sleeping_owl.form', function () use ($alias) { |
|
| 127 | + $this->app->singleton('sleeping_owl.form', function() use ($alias) { |
|
| 128 | 128 | return $alias; |
| 129 | 129 | }); |
| 130 | 130 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | 'related' => \SleepingOwl\Admin\Display\Filter\FilterRelated::class, |
| 139 | 139 | ]); |
| 140 | 140 | |
| 141 | - $this->app->singleton('sleeping_owl.display.filter', function () use ($alias) { |
|
| 141 | + $this->app->singleton('sleeping_owl.display.filter', function() use ($alias) { |
|
| 142 | 142 | return $alias; |
| 143 | 143 | }); |
| 144 | 144 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | | |
| 46 | 46 | */ |
| 47 | 47 | |
| 48 | - 'middleware' => ['web'], |
|
| 48 | + 'middleware' => [ 'web' ], |
|
| 49 | 49 | |
| 50 | 50 | /* |
| 51 | 51 | |-------------------------------------------------------------------------- |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * See https://github.com/NextStepWebs/simplemde-markdown-editor |
| 134 | 134 | */ |
| 135 | 135 | 'simplemde' => [ |
| 136 | - 'hideIcons' => ['side-by-side', 'fullscreen'], |
|
| 136 | + 'hideIcons' => [ 'side-by-side', 'fullscreen' ], |
|
| 137 | 137 | ], |
| 138 | 138 | ], |
| 139 | 139 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | | Select default settings for datatable |
| 146 | 146 | | |
| 147 | 147 | */ |
| 148 | - 'datatables' => [], |
|
| 148 | + 'datatables' => [ ], |
|
| 149 | 149 | |
| 150 | 150 | /* |
| 151 | 151 | |-------------------------------------------------------------------------- |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | /** |
| 23 | 23 | * @param array|string $scopes |
| 24 | 24 | * |
| 25 | - * @return $this |
|
| 25 | + * @return \SleepingOwl\Admin\Contracts\DisplayInterface |
|
| 26 | 26 | */ |
| 27 | 27 | public function set($scopes) |
| 28 | 28 | { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function set($actions) |
| 50 | 50 | { |
| 51 | - if (! is_array($actions)) { |
|
| 51 | + if (!is_array($actions)) { |
|
| 52 | 52 | $actions = func_get_args(); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -144,19 +144,19 @@ discard block |
||
| 144 | 144 | return; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - $this->all()->each(function (ActionInterface $action) { |
|
| 147 | + $this->all()->each(function(ActionInterface $action) { |
|
| 148 | 148 | $action->initialize(); |
| 149 | 149 | }); |
| 150 | 150 | |
| 151 | 151 | $this->setHtmlAttribute('data-type', 'display-actions'); |
| 152 | 152 | |
| 153 | - if (! $this->hasHtmlAttribute('class')) { |
|
| 153 | + if (!$this->hasHtmlAttribute('class')) { |
|
| 154 | 154 | $this->setHtmlAttribute('class', 'panel-footer'); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | $template = app('sleeping_owl.template')->getViewPath($this->getDisplay()->getView()); |
| 158 | 158 | |
| 159 | - view()->composer($template, function (\Illuminate\View\View $view) { |
|
| 159 | + view()->composer($template, function(\Illuminate\View\View $view) { |
|
| 160 | 160 | $view->getFactory()->inject( |
| 161 | 161 | $this->getPlacement(), |
| 162 | 162 | app('sleeping_owl.template')->view($this->getView(), $this->toArray()) |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | /** |
| 81 | 81 | * @param string $editorId |
| 82 | 82 | * |
| 83 | - * @return bool |
|
| 83 | + * @return boolean|null |
|
| 84 | 84 | */ |
| 85 | 85 | public function loadEditor($editorId) |
| 86 | 86 | { |
@@ -37,29 +37,29 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | $this->navigation->setCurrentUrl($request->url()); |
| 39 | 39 | |
| 40 | - Breadcrumbs::register('home', function ($breadcrumbs) { |
|
| 40 | + Breadcrumbs::register('home', function($breadcrumbs) { |
|
| 41 | 41 | $breadcrumbs->push(trans('sleeping_owl::lang.dashboard'), route('admin.dashboard')); |
| 42 | 42 | }); |
| 43 | 43 | |
| 44 | - $breadcrumbs = []; |
|
| 44 | + $breadcrumbs = [ ]; |
|
| 45 | 45 | |
| 46 | 46 | if ($currentPage = $this->navigation->getCurrentPage()) { |
| 47 | 47 | foreach ($currentPage->getPathArray() as $page) { |
| 48 | - $breadcrumbs[] = [ |
|
| 49 | - 'id' => $page['id'], |
|
| 50 | - 'title' => $page['title'], |
|
| 51 | - 'url' => $page['url'], |
|
| 48 | + $breadcrumbs[ ] = [ |
|
| 49 | + 'id' => $page[ 'id' ], |
|
| 50 | + 'title' => $page[ 'title' ], |
|
| 51 | + 'url' => $page[ 'url' ], |
|
| 52 | 52 | 'parent' => $this->parentBreadcrumb, |
| 53 | 53 | ]; |
| 54 | 54 | |
| 55 | - $this->parentBreadcrumb = $page['id']; |
|
| 55 | + $this->parentBreadcrumb = $page[ 'id' ]; |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | foreach ($breadcrumbs as $breadcrumb) { |
| 60 | - Breadcrumbs::register($breadcrumb['id'], function ($breadcrumbs) use ($breadcrumb) { |
|
| 61 | - $breadcrumbs->parent($breadcrumb['parent']); |
|
| 62 | - $breadcrumbs->push($breadcrumb['title'], $breadcrumb['url']); |
|
| 60 | + Breadcrumbs::register($breadcrumb[ 'id' ], function($breadcrumbs) use ($breadcrumb) { |
|
| 61 | + $breadcrumbs->parent($breadcrumb[ 'parent' ]); |
|
| 62 | + $breadcrumbs->push($breadcrumb[ 'title' ], $breadcrumb[ 'url' ]); |
|
| 63 | 63 | }); |
| 64 | 64 | } |
| 65 | 65 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function getDisplay(ModelConfiguration $model) |
| 73 | 73 | { |
| 74 | - if (! $model->isDisplayable()) { |
|
| 74 | + if (!$model->isDisplayable()) { |
|
| 75 | 75 | abort(404); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function getCreate(ModelConfiguration $model) |
| 87 | 87 | { |
| 88 | - if (! $model->isCreatable()) { |
|
| 88 | + if (!$model->isCreatable()) { |
|
| 89 | 89 | abort(404); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function postStore(ModelConfiguration $model) |
| 105 | 105 | { |
| 106 | - if (! $model->isCreatable()) { |
|
| 106 | + if (!$model->isCreatable()) { |
|
| 107 | 107 | abort(404); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | { |
| 164 | 164 | $item = $model->getRepository()->find($id); |
| 165 | 165 | |
| 166 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
| 166 | + if (is_null($item) || !$model->isEditable($item)) { |
|
| 167 | 167 | abort(404); |
| 168 | 168 | } |
| 169 | 169 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | { |
| 183 | 183 | $item = $model->getRepository()->find($id); |
| 184 | 184 | |
| 185 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
| 185 | + if (is_null($item) || !$model->isEditable($item)) { |
|
| 186 | 186 | abort(404); |
| 187 | 187 | } |
| 188 | 188 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | $display = $model->fireDisplay(); |
| 239 | 239 | |
| 240 | 240 | /** @var ColumnEditableInterface|null $column */ |
| 241 | - $column = $display->getColumns()->all()->filter(function ($column) use ($field) { |
|
| 241 | + $column = $display->getColumns()->all()->filter(function($column) use ($field) { |
|
| 242 | 242 | return ($column instanceof ColumnEditableInterface) and $field == $column->getName(); |
| 243 | 243 | })->first(); |
| 244 | 244 | |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $repository = $model->getRepository(); |
| 250 | 250 | $item = $repository->find($id); |
| 251 | 251 | |
| 252 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
| 252 | + if (is_null($item) || !$model->isEditable($item)) { |
|
| 253 | 253 | abort(404); |
| 254 | 254 | } |
| 255 | 255 | |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | { |
| 275 | 275 | $item = $model->getRepository()->find($id); |
| 276 | 276 | |
| 277 | - if (is_null($item) || ! $model->isDeletable($item)) { |
|
| 277 | + if (is_null($item) || !$model->isDeletable($item)) { |
|
| 278 | 278 | abort(404); |
| 279 | 279 | } |
| 280 | 280 | |
@@ -299,13 +299,13 @@ discard block |
||
| 299 | 299 | */ |
| 300 | 300 | public function postRestore($model, $id) |
| 301 | 301 | { |
| 302 | - if (! $model->isRestorableModel()) { |
|
| 302 | + if (!$model->isRestorableModel()) { |
|
| 303 | 303 | abort(404); |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | $item = $model->getRepository()->findOnlyTrashed($id); |
| 307 | 307 | |
| 308 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
| 308 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
| 309 | 309 | abort(404); |
| 310 | 310 | } |
| 311 | 311 | |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | { |
| 373 | 373 | $lang = trans('sleeping_owl::lang'); |
| 374 | 374 | if ($lang == 'sleeping_owl::lang') { |
| 375 | - $lang = trans('sleeping_owl::lang', [], 'messages', 'en'); |
|
| 375 | + $lang = trans('sleeping_owl::lang', [ ], 'messages', 'en'); |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | $data = [ |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | { |
| 414 | 414 | if (($backUrl = Request::input('_redirectBack')) == \URL::previous()) { |
| 415 | 415 | $backUrl = null; |
| 416 | - Request::merge(['_redirectBack' => $backUrl]); |
|
| 416 | + Request::merge([ '_redirectBack' => $backUrl ]); |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | return $backUrl; |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | */ |
| 431 | 431 | protected function registerBreadcrumb($title, $parent) |
| 432 | 432 | { |
| 433 | - Breadcrumbs::register('render', function ($breadcrumbs) use ($title, $parent) { |
|
| 433 | + Breadcrumbs::register('render', function($breadcrumbs) use ($title, $parent) { |
|
| 434 | 434 | $breadcrumbs->parent($parent); |
| 435 | 435 | $breadcrumbs->push($title); |
| 436 | 436 | }); |
@@ -62,6 +62,6 @@ |
||
| 62 | 62 | | |
| 63 | 63 | */ |
| 64 | 64 | |
| 65 | - 'attributes' => [], |
|
| 65 | + 'attributes' => [ ], |
|
| 66 | 66 | |
| 67 | 67 | ]; |
@@ -87,6 +87,6 @@ |
||
| 87 | 87 | | |
| 88 | 88 | */ |
| 89 | 89 | |
| 90 | - 'attributes' => [], |
|
| 90 | + 'attributes' => [ ], |
|
| 91 | 91 | |
| 92 | 92 | ]; |
@@ -87,6 +87,6 @@ |
||
| 87 | 87 | | |
| 88 | 88 | */ |
| 89 | 89 | |
| 90 | - 'attributes' => [], |
|
| 90 | + 'attributes' => [ ], |
|
| 91 | 91 | |
| 92 | 92 | ]; |