@@ -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 |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $this->repository = $this->makeRepository(); |
168 | 168 | $this->repository->with($this->with); |
169 | 169 | |
170 | - $this->extensions->each(function (DisplayExtensionInterface $extension) { |
|
170 | + $this->extensions->each(function(DisplayExtensionInterface $extension) { |
|
171 | 171 | if ($extension instanceof Initializable) { |
172 | 172 | $extension->initialize(); |
173 | 173 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $this->title, |
202 | 202 | ]; |
203 | 203 | |
204 | - $this->getExtensions()->each(function (DisplayExtensionInterface $extension) use (&$titles) { |
|
204 | + $this->getExtensions()->each(function(DisplayExtensionInterface $extension) use (&$titles) { |
|
205 | 205 | if (method_exists($extension, $method = 'getTitle')) { |
206 | 206 | $titles[] = call_user_func([$extension, $method]); |
207 | 207 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | |
268 | 268 | $blocks = []; |
269 | 269 | |
270 | - $placableExtensions = $this->getExtensions()->filter(function ($extension) { |
|
270 | + $placableExtensions = $this->getExtensions()->filter(function($extension) { |
|
271 | 271 | return $extension instanceof Placable; |
272 | 272 | }); |
273 | 273 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | foreach ($blocks as $block => $data) { |
282 | 282 | foreach ($data as $html) { |
283 | - if (! empty($html)) { |
|
283 | + if (!empty($html)) { |
|
284 | 284 | $view->getFactory()->startSection($block); |
285 | 285 | echo $html; |
286 | 286 | $view->getFactory()->yieldSection(); |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | { |
339 | 339 | $repository = app($this->repositoryClass, [$this->modelClass]); |
340 | 340 | |
341 | - if (! ($repository instanceof RepositoryInterface)) { |
|
341 | + if (!($repository instanceof RepositoryInterface)) { |
|
342 | 342 | throw new \Exception('Repository class must be instanced of [RepositoryInterface]'); |
343 | 343 | } |
344 | 344 |
@@ -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 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | { |
44 | 44 | $this->initializeElements(); |
45 | 45 | |
46 | - $activeTabs = $this->getTabs()->filter(function (TabInterface $tab) { |
|
46 | + $activeTabs = $this->getTabs()->filter(function(TabInterface $tab) { |
|
47 | 47 | return $tab->isActive(); |
48 | 48 | })->count(); |
49 | 49 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function setModelClass($class) |
59 | 59 | { |
60 | - $this->getTabs()->each(function (TabInterface $tab) use ($class) { |
|
60 | + $this->getTabs()->each(function(TabInterface $tab) use ($class) { |
|
61 | 61 | if ($tab instanceof DisplayInterface) { |
62 | 62 | $tab->setModelClass($class); |
63 | 63 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function setAction($action) |
139 | 139 | { |
140 | - $this->getTabs()->each(function (TabInterface $tab) use ($action) { |
|
140 | + $this->getTabs()->each(function(TabInterface $tab) use ($action) { |
|
141 | 141 | if ($tab instanceof FormInterface) { |
142 | 142 | $tab->setAction($action); |
143 | 143 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function setId($id) |
151 | 151 | { |
152 | - $this->getTabs()->each(function (TabInterface $tab) use ($id) { |
|
152 | + $this->getTabs()->each(function(TabInterface $tab) use ($id) { |
|
153 | 153 | if ($tab instanceof FormInterface) { |
154 | 154 | $tab->setId($id); |
155 | 155 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function validateForm(ModelConfigurationInterface $model) |
165 | 165 | { |
166 | - $this->getTabs()->each(function ($tab) use ($model) { |
|
166 | + $this->getTabs()->each(function($tab) use ($model) { |
|
167 | 167 | if ($tab instanceof FormInterface) { |
168 | 168 | $tab->validateForm($model); |
169 | 169 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function saveForm(ModelConfigurationInterface $model) |
177 | 177 | { |
178 | - $this->getTabs()->each(function (TabInterface $tab) use ($model) { |
|
178 | + $this->getTabs()->each(function(TabInterface $tab) use ($model) { |
|
179 | 179 | if ($tab instanceof FormInterface) { |
180 | 180 | $tab->saveForm($model); |
181 | 181 | } |
@@ -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 |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | $this->navigation = $application['sleeping_owl.navigation']; |
44 | 44 | $this->navigation->setCurrentUrl($request->url()); |
45 | 45 | |
46 | - if (! Breadcrumbs::exists('home')) { |
|
47 | - Breadcrumbs::register('home', function ($breadcrumbs) { |
|
46 | + if (!Breadcrumbs::exists('home')) { |
|
47 | + Breadcrumbs::register('home', function($breadcrumbs) { |
|
48 | 48 | $breadcrumbs->push(trans('sleeping_owl::lang.dashboard'), route('admin.dashboard')); |
49 | 49 | }); |
50 | 50 | } |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | foreach ($breadcrumbs as $breadcrumb) { |
68 | - if (! Breadcrumbs::exists($breadcrumb['id'])) { |
|
69 | - Breadcrumbs::register($breadcrumb['id'], function ($breadcrumbs) use ($breadcrumb) { |
|
68 | + if (!Breadcrumbs::exists($breadcrumb['id'])) { |
|
69 | + Breadcrumbs::register($breadcrumb['id'], function($breadcrumbs) use ($breadcrumb) { |
|
70 | 70 | $breadcrumbs->parent($breadcrumb['parent']); |
71 | 71 | $breadcrumbs->push($breadcrumb['title'], $breadcrumb['url']); |
72 | 72 | }); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function getDisplay(ModelConfigurationInterface $model) |
112 | 112 | { |
113 | - if (! $model->isDisplayable()) { |
|
113 | + if (!$model->isDisplayable()) { |
|
114 | 114 | abort(404); |
115 | 115 | } |
116 | 116 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function getCreate(ModelConfigurationInterface $model) |
128 | 128 | { |
129 | - if (! $model->isCreatable()) { |
|
129 | + if (!$model->isCreatable()) { |
|
130 | 130 | abort(404); |
131 | 131 | } |
132 | 132 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function postStore(ModelConfigurationInterface $model, Request $request) |
148 | 148 | { |
149 | - if (! $model->isCreatable()) { |
|
149 | + if (!$model->isCreatable()) { |
|
150 | 150 | abort(404); |
151 | 151 | } |
152 | 152 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $redirectPolicy = $model->getRedirect(); |
183 | 183 | |
184 | 184 | /* Make redirect when use in model config && Fix editable redirect */ |
185 | - if ($redirectPolicy->get('create') == 'display' || ! $model->isEditable($newModel)) { |
|
185 | + if ($redirectPolicy->get('create') == 'display' || !$model->isEditable($newModel)) { |
|
186 | 186 | $redirectUrl = $model->getDisplayUrl(); |
187 | 187 | } |
188 | 188 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | { |
220 | 220 | $item = $model->getRepository()->find($id); |
221 | 221 | |
222 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
222 | + if (is_null($item) || !$model->isEditable($item)) { |
|
223 | 223 | abort(404); |
224 | 224 | } |
225 | 225 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $editForm = $model->fireEdit($id); |
244 | 244 | $item = $editForm->getModel(); |
245 | 245 | |
246 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
246 | + if (is_null($item) || !$model->isEditable($item)) { |
|
247 | 247 | abort(404); |
248 | 248 | } |
249 | 249 | |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | $display = $model->fireDisplay(); |
319 | 319 | |
320 | 320 | /** @var ColumnEditableInterface|null $column */ |
321 | - $column = $display->getColumns()->all()->filter(function ($column) use ($field) { |
|
321 | + $column = $display->getColumns()->all()->filter(function($column) use ($field) { |
|
322 | 322 | return ($column instanceof ColumnEditableInterface) and $field == $column->getName(); |
323 | 323 | })->first(); |
324 | 324 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | $repository = $model->getRepository(); |
330 | 330 | $item = $repository->find($id); |
331 | 331 | |
332 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
332 | + if (is_null($item) || !$model->isEditable($item)) { |
|
333 | 333 | abort(404); |
334 | 334 | } |
335 | 335 | |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | { |
357 | 357 | $item = $model->getRepository()->find($id); |
358 | 358 | |
359 | - if (is_null($item) || ! $model->isDeletable($item)) { |
|
359 | + if (is_null($item) || !$model->isDeletable($item)) { |
|
360 | 360 | abort(404); |
361 | 361 | } |
362 | 362 | |
@@ -385,13 +385,13 @@ discard block |
||
385 | 385 | */ |
386 | 386 | public function deleteDestroy(ModelConfigurationInterface $model, Request $request, $id) |
387 | 387 | { |
388 | - if (! $model->isRestorableModel()) { |
|
388 | + if (!$model->isRestorableModel()) { |
|
389 | 389 | abort(404); |
390 | 390 | } |
391 | 391 | |
392 | 392 | $item = $model->getRepository()->findOnlyTrashed($id); |
393 | 393 | |
394 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
394 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
395 | 395 | abort(404); |
396 | 396 | } |
397 | 397 | |
@@ -420,13 +420,13 @@ discard block |
||
420 | 420 | */ |
421 | 421 | public function postRestore(ModelConfigurationInterface $model, Request $request, $id) |
422 | 422 | { |
423 | - if (! $model->isRestorableModel()) { |
|
423 | + if (!$model->isRestorableModel()) { |
|
424 | 424 | abort(404); |
425 | 425 | } |
426 | 426 | |
427 | 427 | $item = $model->getRepository()->findOnlyTrashed($id); |
428 | 428 | |
429 | - if (is_null($item) || ! $model->isRestorable($item)) { |
|
429 | + if (is_null($item) || !$model->isRestorable($item)) { |
|
430 | 430 | abort(404); |
431 | 431 | } |
432 | 432 | |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | */ |
553 | 553 | protected function registerBreadcrumb($title, $parent) |
554 | 554 | { |
555 | - Breadcrumbs::register('render', function ($breadcrumbs) use ($title, $parent) { |
|
555 | + Breadcrumbs::register('render', function($breadcrumbs) use ($title, $parent) { |
|
556 | 556 | $breadcrumbs->parent($parent); |
557 | 557 | $breadcrumbs->push($title); |
558 | 558 | }); |