@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | */ |
77 | 77 | protected function getFormatedDate($date) |
78 | 78 | { |
79 | - if (! is_null($date)) { |
|
80 | - if (! $date instanceof Carbon) { |
|
79 | + if (!is_null($date)) { |
|
80 | + if (!$date instanceof Carbon) { |
|
81 | 81 | $date = Carbon::parse($date); |
82 | 82 | } |
83 | 83 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | public function getValueFromModel() |
94 | 94 | { |
95 | 95 | $value = parent::getValueFromModel(); |
96 | - if (! empty($value)) { |
|
96 | + if (!empty($value)) { |
|
97 | 97 | return $this->parseValue($value); |
98 | 98 | } |
99 | 99 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function setModelAttribute($value) |
127 | 127 | { |
128 | - $value = ! empty($value) |
|
128 | + $value = !empty($value) |
|
129 | 129 | ? Carbon::createFromFormat($this->getPickerFormat(), $value, $this->getTimezone()) |
130 | 130 | ->timezone(config('app.timezone'))->format($this->getFormat()) |
131 | 131 | : null; |
@@ -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 | }, 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 | }, 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 | }, 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 | }, 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 | ]; |