@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | public static function registerRoutes(Router $router) |
29 | 29 | { |
30 | 30 | $routeName = 'admin.display.column.move-up'; |
31 | - if (! $router->has($routeName)) { |
|
31 | + if (!$router->has($routeName)) { |
|
32 | 32 | $router->post('{adminModel}/{adminModelId}/up', [ |
33 | 33 | 'as' => $routeName, |
34 | 34 | 'uses' => '\SleepingOwl\Admin\Http\Controllers\DisplayColumnController@orderUp', |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | $routeName = 'admin.display.column.move-down'; |
39 | - if (! $router->has($routeName)) { |
|
39 | + if (!$router->has($routeName)) { |
|
40 | 40 | $router->post('{adminModel}/{adminModelId}/down', [ |
41 | 41 | 'as' => $routeName, |
42 | 42 | 'uses' => '\SleepingOwl\Admin\Http\Controllers\DisplayColumnController@orderDown', |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function getModel() |
58 | 58 | { |
59 | - if (! in_array(OrderableModel::class, trait_uses_recursive($class = get_class($this->model)))) { |
|
59 | + if (!in_array(OrderableModel::class, trait_uses_recursive($class = get_class($this->model)))) { |
|
60 | 60 | throw new \Exception("Model [$class] should uses trait [SleepingOwl\\Admin\\Traits\\OrderableModel]"); |
61 | 61 | } |
62 | 62 |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | { |
65 | 65 | parent::initialize(); |
66 | 66 | |
67 | - $this->buttons->put('edit', $button = new ControlLink(function (Model $model) { |
|
67 | + $this->buttons->put('edit', $button = new ControlLink(function(Model $model) { |
|
68 | 68 | return $this->getModelConfiguration()->getEditUrl($model->getKey()); |
69 | 69 | }, (string) trans('sleeping_owl::lang.table.edit'), 100)); |
70 | 70 | $button->hideText(); |
71 | - $button->setCondition(function () { |
|
71 | + $button->setCondition(function() { |
|
72 | 72 | return $this->isEditable(); |
73 | 73 | }); |
74 | 74 | $button->setIcon('fa fa-pencil'); |
75 | 75 | $button->setHtmlAttribute('class', 'btn-primary'); |
76 | 76 | |
77 | - $this->buttons->put('delete', $button = new ControlButton(function (Model $model) { |
|
77 | + $this->buttons->put('delete', $button = new ControlButton(function(Model $model) { |
|
78 | 78 | return $this->getModelConfiguration()->getDeleteUrl($model->getKey()); |
79 | 79 | }, (string) trans('sleeping_owl::lang.table.delete'), 200)); |
80 | - $button->setCondition(function () { |
|
80 | + $button->setCondition(function() { |
|
81 | 81 | return $this->isDeletable(); |
82 | 82 | }); |
83 | 83 | |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | $button->setIcon('fa fa-trash'); |
87 | 87 | $button->setHtmlAttribute('class', 'btn-danger btn-delete'); |
88 | 88 | |
89 | - $this->buttons->put('destroy', $button = new ControlButton(function (Model $model) { |
|
89 | + $this->buttons->put('destroy', $button = new ControlButton(function(Model $model) { |
|
90 | 90 | return $this->getModelConfiguration()->getDestroyUrl($model->getKey()); |
91 | 91 | }, (string) trans('sleeping_owl::lang.table.destroy'), 300)); |
92 | - $button->setCondition(function () { |
|
92 | + $button->setCondition(function() { |
|
93 | 93 | return $this->isDestroyable(); |
94 | 94 | }); |
95 | 95 | |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | $button->setIcon('fa fa-trash'); |
99 | 99 | $button->setHtmlAttribute('class', 'btn-danger btn-destroy'); |
100 | 100 | |
101 | - $this->buttons->put('restore', $button = new ControlButton(function (Model $model) { |
|
101 | + $this->buttons->put('restore', $button = new ControlButton(function(Model $model) { |
|
102 | 102 | return $this->getModelConfiguration()->getRestoreUrl($model->getKey()); |
103 | 103 | }, (string) trans('sleeping_owl::lang.table.restore'), 400)); |
104 | - $button->setCondition(function () { |
|
104 | + $button->setCondition(function() { |
|
105 | 105 | return $this->isRestorable(); |
106 | 106 | }); |
107 | 107 | $button->hideText(); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | return |
206 | 206 | $this->editable |
207 | 207 | && |
208 | - ! $this->isTrashed() |
|
208 | + !$this->isTrashed() |
|
209 | 209 | && |
210 | 210 | $this->getModelConfiguration()->isEditable( |
211 | 211 | $this->getModel() |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | return |
223 | 223 | $this->deletable |
224 | 224 | && |
225 | - ! $this->isTrashed() |
|
225 | + !$this->isTrashed() |
|
226 | 226 | && |
227 | 227 | $this->getModelConfiguration()->isDeletable( |
228 | 228 | $this->getModel() |
@@ -282,13 +282,13 @@ discard block |
||
282 | 282 | { |
283 | 283 | return parent::toArray() + [ |
284 | 284 | 'buttons' => $this->buttons |
285 | - ->each(function (ControlButtonInterface $button) { |
|
285 | + ->each(function(ControlButtonInterface $button) { |
|
286 | 286 | $button->setModel($this->getModel()); |
287 | 287 | }) |
288 | - ->filter(function (ControlButtonInterface $button) { |
|
288 | + ->filter(function(ControlButtonInterface $button) { |
|
289 | 289 | return $button->isActive(); |
290 | 290 | }) |
291 | - ->sortBy(function (ControlButtonInterface $button) { |
|
291 | + ->sortBy(function(ControlButtonInterface $button) { |
|
292 | 292 | return $button->getPosition(); |
293 | 293 | }), |
294 | 294 | ]; |
@@ -59,8 +59,8 @@ |
||
59 | 59 | */ |
60 | 60 | protected function getFormatedDate($date) |
61 | 61 | { |
62 | - if (! is_null($date)) { |
|
63 | - if (! ($date instanceof Carbon)) { |
|
62 | + if (!is_null($date)) { |
|
63 | + if (!($date instanceof Carbon)) { |
|
64 | 64 | $date = Carbon::parse($date); |
65 | 65 | } |
66 | 66 |