@@ -54,7 +54,7 @@ |
||
| 54 | 54 | */ |
| 55 | 55 | public function setModel($model) |
| 56 | 56 | { |
| 57 | - if (! class_exists($model)) { |
|
| 57 | + if (!class_exists($model)) { |
|
| 58 | 58 | throw new Exception("Class model [$model] not found"); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | public function toArray() |
| 47 | 47 | { |
| 48 | 48 | $value = $this->getModelValue(); |
| 49 | - if (! empty($value) && (strpos($value, '://') === false)) { |
|
| 49 | + if (!empty($value) && (strpos($value, '://') === false)) { |
|
| 50 | 50 | $value = asset($value); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function set($actions) |
| 51 | 51 | { |
| 52 | - if (! is_array($actions)) { |
|
| 52 | + if (!is_array($actions)) { |
|
| 53 | 53 | $actions = func_get_args(); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -145,13 +145,13 @@ discard block |
||
| 145 | 145 | return; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - $this->all()->each(function (ActionInterface $action) { |
|
| 148 | + $this->all()->each(function(ActionInterface $action) { |
|
| 149 | 149 | $action->initialize(); |
| 150 | 150 | }); |
| 151 | 151 | |
| 152 | 152 | $this->setHtmlAttribute('data-type', 'display-actions'); |
| 153 | 153 | |
| 154 | - if (! $this->hasHtmlAttribute('class')) { |
|
| 154 | + if (!$this->hasHtmlAttribute('class')) { |
|
| 155 | 155 | $this->setHtmlAttribute('class', 'panel-footer'); |
| 156 | 156 | } |
| 157 | 157 | } |
@@ -152,7 +152,7 @@ |
||
| 152 | 152 | |
| 153 | 153 | public function initialize() |
| 154 | 154 | { |
| 155 | - $this->allWithControl()->each(function (ColumnInterface $column) { |
|
| 155 | + $this->allWithControl()->each(function(ColumnInterface $column) { |
|
| 156 | 156 | $column->initialize(); |
| 157 | 157 | }); |
| 158 | 158 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function setItems($items) |
| 42 | 42 | { |
| 43 | - if (! is_array($items)) { |
|
| 43 | + if (!is_array($items)) { |
|
| 44 | 44 | $items = func_get_args(); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function addHeader($items) |
| 70 | 70 | { |
| 71 | - if (! is_array($items)) { |
|
| 71 | + if (!is_array($items)) { |
|
| 72 | 72 | $items = func_get_args(); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function addBody($items) |
| 86 | 86 | { |
| 87 | - if (! is_array($items)) { |
|
| 87 | + if (!is_array($items)) { |
|
| 88 | 88 | $items = func_get_args(); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function addFooter($items) |
| 106 | 106 | { |
| 107 | - if (! is_array($items)) { |
|
| 107 | + if (!is_array($items)) { |
|
| 108 | 108 | $items = func_get_args(); |
| 109 | 109 | } |
| 110 | 110 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function __construct(Closure $callback = null) |
| 26 | 26 | { |
| 27 | - if (! is_null($callback)) { |
|
| 27 | + if (!is_null($callback)) { |
|
| 28 | 28 | $this->setCallback($callback); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -38,8 +38,8 @@ |
||
| 38 | 38 | $relationName = implode('.', $parts); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - if (! is_null($relationName)) { |
|
| 42 | - $query->whereHas($relationName, function ($q) use ($name, $value) { |
|
| 41 | + if (!is_null($relationName)) { |
|
| 42 | + $query->whereHas($relationName, function($q) use ($name, $value) { |
|
| 43 | 43 | $this->buildQuery($q, $name, $value); |
| 44 | 44 | }); |
| 45 | 45 | } else { |
@@ -313,11 +313,11 @@ discard block |
||
| 313 | 313 | */ |
| 314 | 314 | public function isShowDeleteButton() |
| 315 | 315 | { |
| 316 | - if (is_null($this->getModel()->getKey()) || ! $this->showDeleteButton) { |
|
| 316 | + if (is_null($this->getModel()->getKey()) || !$this->showDeleteButton) { |
|
| 317 | 317 | return false; |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | - $this->showDeleteButton = ! $this->isTrashed() && $this->getModelConfiguration()->isDeletable($this->getModel()); |
|
| 320 | + $this->showDeleteButton = !$this->isTrashed() && $this->getModelConfiguration()->isDeletable($this->getModel()); |
|
| 321 | 321 | |
| 322 | 322 | return $this->showDeleteButton; |
| 323 | 323 | } |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | */ |
| 338 | 338 | public function isShowDestroyButton() |
| 339 | 339 | { |
| 340 | - if (is_null($this->getModel()->getKey()) || ! $this->showDestroyButton) { |
|
| 340 | + if (is_null($this->getModel()->getKey()) || !$this->showDestroyButton) { |
|
| 341 | 341 | return false; |
| 342 | 342 | } |
| 343 | 343 | |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | */ |
| 363 | 363 | public function isShowRestoreButton() |
| 364 | 364 | { |
| 365 | - if (is_null($this->getModel()->getKey()) || ! $this->showRestoreButton) { |
|
| 365 | + if (is_null($this->getModel()->getKey()) || !$this->showRestoreButton) { |
|
| 366 | 366 | return false; |
| 367 | 367 | } |
| 368 | 368 | |
@@ -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(); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | return |
| 190 | 190 | $this->editable |
| 191 | 191 | && |
| 192 | - ! $this->isTrashed() |
|
| 192 | + !$this->isTrashed() |
|
| 193 | 193 | && |
| 194 | 194 | $this->getModelConfiguration()->isEditable( |
| 195 | 195 | $this->getModel() |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | return |
| 207 | 207 | $this->deletable |
| 208 | 208 | && |
| 209 | - ! $this->isTrashed() |
|
| 209 | + !$this->isTrashed() |
|
| 210 | 210 | && |
| 211 | 211 | $this->getModelConfiguration()->isDeletable( |
| 212 | 212 | $this->getModel() |
@@ -266,13 +266,13 @@ discard block |
||
| 266 | 266 | { |
| 267 | 267 | return parent::toArray() + [ |
| 268 | 268 | 'buttons' => $this->buttons |
| 269 | - ->each(function (ControlButtonInterface $button) { |
|
| 269 | + ->each(function(ControlButtonInterface $button) { |
|
| 270 | 270 | $button->setModel($this->getModel()); |
| 271 | 271 | }) |
| 272 | - ->filter(function (ControlButtonInterface $button) { |
|
| 272 | + ->filter(function(ControlButtonInterface $button) { |
|
| 273 | 273 | return $button->isActive(); |
| 274 | 274 | }) |
| 275 | - ->sortBy(function (ControlButtonInterface $button) { |
|
| 275 | + ->sortBy(function(ControlButtonInterface $button) { |
|
| 276 | 276 | return $button->getPosition(); |
| 277 | 277 | }), |
| 278 | 278 | ]; |