@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function push($scope) |
40 | 40 | { |
41 | - if (! is_array($scope)) { |
|
41 | + if (!is_array($scope)) { |
|
42 | 42 | $scope = func_get_args(); |
43 | 43 | } |
44 | 44 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public function modifyQuery(Builder $query) |
66 | 66 | { |
67 | 67 | foreach ($this->scopes as $scope) { |
68 | - if (! is_null($scope)) { |
|
68 | + if (!is_null($scope)) { |
|
69 | 69 | if (is_array($scope)) { |
70 | 70 | $method = array_shift($scope); |
71 | 71 | $params = $scope; |
@@ -87,7 +87,7 @@ |
||
87 | 87 | */ |
88 | 88 | public function setOrder($order) |
89 | 89 | { |
90 | - if (! is_array($order)) { |
|
90 | + if (!is_array($order)) { |
|
91 | 91 | $order = func_get_args(); |
92 | 92 | } |
93 | 93 |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | $this->header = app(TableHeaderColumnInterface::class); |
66 | 66 | |
67 | - if (! is_null($label)) { |
|
67 | + if (!is_null($label)) { |
|
68 | 68 | $this->setLabel($label); |
69 | 69 | } |
70 | 70 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $orderable = new OrderByClause($orderable); |
207 | 207 | } |
208 | 208 | |
209 | - if ($orderable !== false && ! $orderable instanceof OrderByClauseInterface) { |
|
209 | + if ($orderable !== false && !$orderable instanceof OrderByClauseInterface) { |
|
210 | 210 | throw new \InvalidArgumentException('Argument must be instance of SleepingOwl\Admin\Contracts\Display\OrderByClauseInterface interface'); |
211 | 211 | } |
212 | 212 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function orderBy(Builder $query, $direction) |
235 | 235 | { |
236 | - if (! $this->isOrderable()) { |
|
236 | + if (!$this->isOrderable()) { |
|
237 | 237 | throw new \InvalidArgumentException('Argument must be instance of SleepingOwl\Admin\Contracts\Display\OrderByClauseInterface interface'); |
238 | 238 | } |
239 | 239 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | $this->setName($name); |
37 | 37 | |
38 | - if (! is_null($title)) { |
|
38 | + if (!is_null($title)) { |
|
39 | 39 | $this->setTitle($title); |
40 | 40 | } |
41 | 41 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function getAlias() |
79 | 79 | { |
80 | - if (! $this->alias) { |
|
80 | + if (!$this->alias) { |
|
81 | 81 | return $this->getName(); |
82 | 82 | } |
83 | 83 | |
@@ -149,6 +149,6 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function isActive() |
151 | 151 | { |
152 | - return ! is_null($this->getValue()); |
|
152 | + return !is_null($this->getValue()); |
|
153 | 153 | } |
154 | 154 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$router->group(['as' => 'admin.', 'namespace' => 'SleepingOwl\Admin\Http\Controllers'], function ($router) { |
|
4 | - if (! $router->has('admin.dashboard')) { |
|
3 | +$router->group(['as' => 'admin.', 'namespace' => 'SleepingOwl\Admin\Http\Controllers'], function($router) { |
|
4 | + if (!$router->has('admin.dashboard')) { |
|
5 | 5 | $router->get('', ['as' => 'dashboard', 'uses' => 'AdminController@getDashboard']); |
6 | 6 | } |
7 | 7 |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function fromField(Request $request, ModelConfigurationInterface $model, $field, $id = null) |
24 | 24 | { |
25 | - if (! is_null($id)) { |
|
25 | + if (!is_null($id)) { |
|
26 | 26 | $item = $model->getRepository()->find($id); |
27 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
27 | + if (is_null($item) || !$model->isEditable($item)) { |
|
28 | 28 | return new JsonResponse([ |
29 | 29 | 'message' => trans('lang.message.access_denied'), |
30 | 30 | ], 403); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | $form = $model->fireEdit($id); |
34 | 34 | } else { |
35 | - if (! $model->isCreatable()) { |
|
35 | + if (!$model->isCreatable()) { |
|
36 | 36 | return new JsonResponse([ |
37 | 37 | 'message' => trans('lang.message.access_denied'), |
38 | 38 | ], 403); |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | |
51 | 51 | $admin->navigation()->setCurrentUrl($request->url()); |
52 | 52 | |
53 | - if (! $this->breadcrumbs->exists('home')) { |
|
54 | - $this->breadcrumbs->register('home', function ($breadcrumbs) { |
|
53 | + if (!$this->breadcrumbs->exists('home')) { |
|
54 | + $this->breadcrumbs->register('home', function($breadcrumbs) { |
|
55 | 55 | $breadcrumbs->push(trans('sleeping_owl::lang.dashboard'), route('admin.dashboard')); |
56 | 56 | }); |
57 | 57 | } |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | foreach ($breadcrumbs as $breadcrumb) { |
75 | - if (! $this->breadcrumbs->exists($breadcrumb['id'])) { |
|
76 | - $this->breadcrumbs->register($breadcrumb['id'], function ($breadcrumbs) use ($breadcrumb) { |
|
75 | + if (!$this->breadcrumbs->exists($breadcrumb['id'])) { |
|
76 | + $this->breadcrumbs->register($breadcrumb['id'], function($breadcrumbs) use ($breadcrumb) { |
|
77 | 77 | $breadcrumbs->parent($breadcrumb['parent']); |
78 | 78 | $breadcrumbs->push($breadcrumb['title'], $breadcrumb['url']); |
79 | 79 | }); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function getDisplay(ModelConfigurationInterface $model) |
119 | 119 | { |
120 | - if (! $model->isDisplayable()) { |
|
120 | + if (!$model->isDisplayable()) { |
|
121 | 121 | abort(404); |
122 | 122 | } |
123 | 123 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function getCreate(ModelConfigurationInterface $model) |
135 | 135 | { |
136 | - if (! $model->isCreatable()) { |
|
136 | + if (!$model->isCreatable()) { |
|
137 | 137 | abort(404); |
138 | 138 | } |
139 | 139 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function postStore(ModelConfigurationInterface $model, Request $request) |
154 | 154 | { |
155 | - if (! $model->isCreatable()) { |
|
155 | + if (!$model->isCreatable()) { |
|
156 | 156 | abort(404); |
157 | 157 | } |
158 | 158 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $redirectPolicy = $model->getRedirect(); |
189 | 189 | |
190 | 190 | /* Make redirect when use in model config && Fix editable redirect */ |
191 | - if ($redirectPolicy->get('create') == 'display' || ! $model->isEditable($newModel)) { |
|
191 | + if ($redirectPolicy->get('create') == 'display' || !$model->isEditable($newModel)) { |
|
192 | 192 | $redirectUrl = $model->getDisplayUrl(); |
193 | 193 | } |
194 | 194 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | { |
226 | 226 | $item = $model->getRepository()->find($id); |
227 | 227 | |
228 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
228 | + if (is_null($item) || !$model->isEditable($item)) { |
|
229 | 229 | abort(404); |
230 | 230 | } |
231 | 231 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $editForm = $model->fireEdit($id); |
250 | 250 | $item = $editForm->getModel(); |
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 | |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | $display = $model->fireDisplay(); |
323 | 323 | |
324 | 324 | /** @var ColumnEditableInterface|null $column */ |
325 | - $column = $display->getColumns()->all()->filter(function ($column) use ($field) { |
|
325 | + $column = $display->getColumns()->all()->filter(function($column) use ($field) { |
|
326 | 326 | return ($column instanceof ColumnEditableInterface) and $field == $column->getName(); |
327 | 327 | })->first(); |
328 | 328 | |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | $repository = $model->getRepository(); |
334 | 334 | $item = $repository->find($id); |
335 | 335 | |
336 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
336 | + if (is_null($item) || !$model->isEditable($item)) { |
|
337 | 337 | abort(404); |
338 | 338 | } |
339 | 339 | |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | { |
361 | 361 | $item = $model->getRepository()->find($id); |
362 | 362 | |
363 | - if (is_null($item) || ! $model->isDeletable($item)) { |
|
363 | + if (is_null($item) || !$model->isDeletable($item)) { |
|
364 | 364 | abort(404); |
365 | 365 | } |
366 | 366 | |
@@ -389,13 +389,13 @@ discard block |
||
389 | 389 | */ |
390 | 390 | public function deleteDestroy(ModelConfigurationInterface $model, Request $request, $id) |
391 | 391 | { |
392 | - if (! $model->isRestorableModel()) { |
|
392 | + if (!$model->isRestorableModel()) { |
|
393 | 393 | abort(404); |
394 | 394 | } |
395 | 395 | |
396 | 396 | $item = $model->getRepository()->findOnlyTrashed($id); |
397 | 397 | |
398 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
398 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
399 | 399 | abort(404); |
400 | 400 | } |
401 | 401 | |
@@ -424,13 +424,13 @@ discard block |
||
424 | 424 | */ |
425 | 425 | public function postRestore(ModelConfigurationInterface $model, Request $request, $id) |
426 | 426 | { |
427 | - if (! $model->isRestorableModel()) { |
|
427 | + if (!$model->isRestorableModel()) { |
|
428 | 428 | abort(404); |
429 | 429 | } |
430 | 430 | |
431 | 431 | $item = $model->getRepository()->findOnlyTrashed($id); |
432 | 432 | |
433 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
433 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
434 | 434 | abort(404); |
435 | 435 | } |
436 | 436 | |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | */ |
557 | 557 | protected function registerBreadcrumb($title, $parent) |
558 | 558 | { |
559 | - $this->breadcrumbs->register('render', function ($breadcrumbs) use ($title, $parent) { |
|
559 | + $this->breadcrumbs->register('render', function($breadcrumbs) use ($title, $parent) { |
|
560 | 560 | $breadcrumbs->parent($parent); |
561 | 561 | $breadcrumbs->push($title); |
562 | 562 | }); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | public function aliases() |
14 | 14 | { |
15 | - return $this->map(function (ModelConfigurationInterface $model) { |
|
15 | + return $this->map(function(ModelConfigurationInterface $model) { |
|
16 | 16 | return $model->getAlias(); |
17 | 17 | }); |
18 | 18 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function keyByAlias() |
24 | 24 | { |
25 | - return $this->keyBy(function (ModelConfigurationInterface $model) { |
|
25 | + return $this->keyBy(function(ModelConfigurationInterface $model) { |
|
26 | 26 | return $model->getAlias(); |
27 | 27 | }); |
28 | 28 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function getOptions() |
56 | 56 | { |
57 | - if (! is_null($this->getModelForOptions()) && ! is_null($this->getDisplay())) { |
|
57 | + if (!is_null($this->getModelForOptions()) && !is_null($this->getDisplay())) { |
|
58 | 58 | $this->setOptions( |
59 | 59 | $this->loadOptions() |
60 | 60 | ); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function exclude($keys) |
137 | 137 | { |
138 | - if (! is_array($keys)) { |
|
138 | + if (!is_array($keys)) { |
|
139 | 139 | $keys = func_get_args(); |
140 | 140 | } |
141 | 141 |