@@ -66,7 +66,7 @@ |
||
| 66 | 66 | $parts = explode('.', $name); |
| 67 | 67 | $fieldName = array_pop($parts); |
| 68 | 68 | $relationName = implode('.', $parts); |
| 69 | - $query->whereHas($relationName, function ($q) use ($search, $fieldName) { |
|
| 69 | + $query->whereHas($relationName, function($q) use ($search, $fieldName) { |
|
| 70 | 70 | $this->buildQuery($q, $fieldName, $search); |
| 71 | 71 | }); |
| 72 | 72 | } |
@@ -189,7 +189,7 @@ |
||
| 189 | 189 | $fieldName = array_pop($parts); |
| 190 | 190 | $relationName = implode('.', $parts); |
| 191 | 191 | |
| 192 | - $query->whereHas($relationName, function ($q) use ($name, $time) { |
|
| 192 | + $query->whereHas($relationName, function($q) use ($name, $time) { |
|
| 193 | 193 | $this->buildQuery($q, $name, $time); |
| 194 | 194 | }); |
| 195 | 195 | } |
@@ -106,14 +106,14 @@ |
||
| 106 | 106 | $from = array_get($fullSearch, 'from'); |
| 107 | 107 | $to = array_get($fullSearch, 'to'); |
| 108 | 108 | |
| 109 | - if (! empty($from)) { |
|
| 109 | + if (!empty($from)) { |
|
| 110 | 110 | $this |
| 111 | 111 | ->getFrom() |
| 112 | 112 | ->setOperator(FilterInterface::LESS_OR_EQUAL) |
| 113 | 113 | ->apply($repository, $column, $query, $from, $fullSearch); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if (! empty($to)) { |
|
| 116 | + if (!empty($to)) { |
|
| 117 | 117 | $this |
| 118 | 118 | ->getTo() |
| 119 | 119 | ->setOperator(FilterInterface::LESS_OR_EQUAL) |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * @var array |
| 30 | 30 | */ |
| 31 | - protected $options = []; |
|
| 31 | + protected $options = [ ]; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * @var string |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $model = new $model; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - if (! ($model instanceof Model)) { |
|
| 63 | + if (!($model instanceof Model)) { |
|
| 64 | 64 | throw new \Exception('Model must be an instance of Illuminate\Database\Eloquent\Model'); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function getOptions() |
| 116 | 116 | { |
| 117 | - if (! is_null($this->getModel()) and ! is_null($this->getDisplay())) { |
|
| 117 | + if (!is_null($this->getModel()) and !is_null($this->getDisplay())) { |
|
| 118 | 118 | $this->loadOptions(); |
| 119 | 119 | } |
| 120 | 120 | |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $parts = explode('.', $name); |
| 201 | 201 | $fieldName = array_pop($parts); |
| 202 | 202 | $relationName = implode('.', $parts); |
| 203 | - $query->whereHas($relationName, function ($q) use ($search, $fieldName) { |
|
| 203 | + $query->whereHas($relationName, function($q) use ($search, $fieldName) { |
|
| 204 | 204 | $this->buildQuery($q, $fieldName, $search); |
| 205 | 205 | }); |
| 206 | 206 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | |
| 209 | 209 | protected function loadOptions() |
| 210 | 210 | { |
| 211 | - $repository = app(RepositoryInterface::class, [$this->getModel()]); |
|
| 211 | + $repository = app(RepositoryInterface::class, [ $this->getModel() ]); |
|
| 212 | 212 | |
| 213 | 213 | $key = $repository->getModel()->getKeyName(); |
| 214 | 214 | $options = $repository->getQuery()->get()->lists($this->getDisplay(), $key); |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | { |
| 22 | 22 | parent::__construct($label); |
| 23 | 23 | $this->setLabel( |
| 24 | - Form::checkbox(null, 1, false, ['class' => 'adminCheckboxAll'] |
|
| 24 | + Form::checkbox(null, 1, false, [ 'class' => 'adminCheckboxAll' ] |
|
| 25 | 25 | )); |
| 26 | 26 | |
| 27 | 27 | $this->setOrderable(false); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | protected function isEditable() |
| 65 | 65 | { |
| 66 | 66 | return |
| 67 | - ! $this->isTrashed() |
|
| 67 | + !$this->isTrashed() |
|
| 68 | 68 | && |
| 69 | 69 | $this->getModelConfiguration()->isEditable( |
| 70 | 70 | $this->getModel() |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | protected function isDeletable() |
| 89 | 89 | { |
| 90 | 90 | return |
| 91 | - ! $this->isTrashed() |
|
| 91 | + !$this->isTrashed() |
|
| 92 | 92 | && |
| 93 | 93 | $this->getModelConfiguration()->isDeletable( |
| 94 | 94 | $this->getModel() |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | public function __construct($label = null, Closure $callback = null) |
| 29 | 29 | { |
| 30 | 30 | parent::__construct($label); |
| 31 | - if (! is_null($callback)) { |
|
| 31 | + if (!is_null($callback)) { |
|
| 32 | 32 | $this->setCallback($callback); |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | protected function getValue(Model $model) |
| 65 | 65 | { |
| 66 | - if (! is_callable($callback = $this->getCallback())) { |
|
| 66 | + if (!is_callable($callback = $this->getCallback())) { |
|
| 67 | 67 | throw new \Exception('Invalid custom column callback'); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | { |
| 18 | 18 | Route::post('{adminModel}/{adminModelId}/up', [ |
| 19 | 19 | 'as' => 'admin.model.move-up', |
| 20 | - function ($model, $id) { |
|
| 20 | + function($model, $id) { |
|
| 21 | 21 | $instance = $model->getRepository()->find($id); |
| 22 | 22 | $instance->moveUp(); |
| 23 | 23 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | Route::post('{adminModel}/{adminModelId}/down', [ |
| 29 | 29 | 'as' => 'admin.model.move-down', |
| 30 | - function ($model, $id) { |
|
| 30 | + function($model, $id) { |
|
| 31 | 31 | $instance = $model->getRepository()->find($id); |
| 32 | 32 | $instance->moveDown(); |
| 33 | 33 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function getModel() |
| 50 | 50 | { |
| 51 | - if (! in_array(OrderableModel::class, trait_uses_recursive($class = get_class($this->model)))) { |
|
| 51 | + if (!in_array(OrderableModel::class, trait_uses_recursive($class = get_class($this->model)))) { |
|
| 52 | 52 | throw new \Exception("Model [$class] should uses trait [SleepingOwl\\Admin\\Traits\\OrderableModel]"); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -58,8 +58,8 @@ |
||
| 58 | 58 | $value = $this->getModelValue(); |
| 59 | 59 | $originalValue = $value; |
| 60 | 60 | |
| 61 | - if (! is_null($value)) { |
|
| 62 | - if (! $value instanceof Carbon) { |
|
| 61 | + if (!is_null($value)) { |
|
| 62 | + if (!$value instanceof Carbon) { |
|
| 63 | 63 | $value = Carbon::parse($value); |
| 64 | 64 | } |
| 65 | 65 | |