@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function isCreatable() |
202 | 202 | { |
203 | - if (! is_callable($this->getCreate())) { |
|
203 | + if (!is_callable($this->getCreate())) { |
|
204 | 204 | return false; |
205 | 205 | } |
206 | 206 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | public function isEditable(Model $model) |
226 | 226 | { |
227 | - if (! is_callable($this->getEdit())) { |
|
227 | + if (!is_callable($this->getEdit())) { |
|
228 | 228 | return false; |
229 | 229 | } |
230 | 230 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | */ |
347 | 347 | public function fireDisplay() |
348 | 348 | { |
349 | - if (! is_callable($this->getDisplay())) { |
|
349 | + if (!is_callable($this->getDisplay())) { |
|
350 | 350 | return; |
351 | 351 | } |
352 | 352 | |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | */ |
388 | 388 | public function fireCreate() |
389 | 389 | { |
390 | - if (! is_callable($this->getCreate())) { |
|
390 | + if (!is_callable($this->getCreate())) { |
|
391 | 391 | return; |
392 | 392 | } |
393 | 393 | |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | */ |
435 | 435 | public function fireEdit($id) |
436 | 436 | { |
437 | - if (! is_callable($this->getEdit())) { |
|
437 | + if (!is_callable($this->getEdit())) { |
|
438 | 438 | return; |
439 | 439 | } |
440 | 440 |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | { |
83 | 83 | $name = array_shift($parts); |
84 | 84 | |
85 | - while (! empty($parts)) { |
|
85 | + while (!empty($parts)) { |
|
86 | 86 | $part = array_shift($parts); |
87 | 87 | $name .= "[$part]"; |
88 | 88 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | { |
236 | 236 | $this->addValidationRule('_unique'); |
237 | 237 | |
238 | - if (! is_null($message)) { |
|
238 | + if (!is_null($message)) { |
|
239 | 239 | $this->addValidationMessage('unique', $message); |
240 | 240 | } |
241 | 241 | |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | */ |
344 | 344 | public function getValueFromRequest(\Illuminate\Http\Request $request) |
345 | 345 | { |
346 | - if ($request->hasSession() && ! is_null($value = $request->old($this->getPath()))) { |
|
346 | + if ($request->hasSession() && !is_null($value = $request->old($this->getPath()))) { |
|
347 | 347 | return $value; |
348 | 348 | } |
349 | 349 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | */ |
356 | 356 | public function getValueFromModel() |
357 | 357 | { |
358 | - if (! is_null($value = $this->getValueFromRequest(request()))) { |
|
358 | + if (!is_null($value = $this->getValueFromRequest(request()))) { |
|
359 | 359 | return $value; |
360 | 360 | } |
361 | 361 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | $path = $this->getPath(); |
364 | 364 | $value = $this->getDefaultValue(); |
365 | 365 | |
366 | - if (is_null($model) or ! $model->exists) { |
|
366 | + if (is_null($model) or !$model->exists) { |
|
367 | 367 | return $value; |
368 | 368 | } |
369 | 369 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function getOptions() |
56 | 56 | { |
57 | - if (! is_null($this->getModelForOptions()) && ! is_null($this->getDisplay())) { |
|
57 | + if (!is_null($this->getModelForOptions()) && !is_null($this->getDisplay())) { |
|
58 | 58 | $this->setOptions( |
59 | 59 | $this->loadOptions() |
60 | 60 | ); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function exclude($keys) |
137 | 137 | { |
138 | - if (! is_array($keys)) { |
|
138 | + if (!is_array($keys)) { |
|
139 | 139 | $keys = func_get_args(); |
140 | 140 | } |
141 | 141 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | public function getValueFromModel() |
51 | 51 | { |
52 | 52 | $value = parent::getValueFromModel(); |
53 | - if (! empty($value)) { |
|
53 | + if (!empty($value)) { |
|
54 | 54 | return $this->parseValue($value); |
55 | 55 | } |
56 | 56 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function setModelAttribute($value) |
84 | 84 | { |
85 | - $value = ! empty($value) |
|
85 | + $value = !empty($value) |
|
86 | 86 | ? Carbon::createFromFormat($this->getPickerFormat(), $value)->format($this->getFormat()) |
87 | 87 | : null; |
88 | 88 |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | protected function syncBelongsToManyRelation(\Illuminate\Database\Eloquent\Relations\BelongsToMany $relation, array $values) |
159 | 159 | { |
160 | 160 | foreach ($values as $i => $value) { |
161 | - if (! array_key_exists($value, $this->getOptions()) and $this->isTaggable()) { |
|
161 | + if (!array_key_exists($value, $this->getOptions()) and $this->isTaggable()) { |
|
162 | 162 | $model = clone $this->getModelForOptions(); |
163 | 163 | $model->{$this->getDisplay()} = $value; |
164 | 164 | $model->save(); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $items = $relation->get(); |
180 | 180 | |
181 | 181 | foreach ($items as $item) { |
182 | - if (! in_array($item->getKey(), $values)) { |
|
182 | + if (!in_array($item->getKey(), $values)) { |
|
183 | 183 | if ($this->isDeleteRelatedItem()) { |
184 | 184 | $item->delete(); |
185 | 185 | } else { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $item = $model->find($value); |
203 | 203 | |
204 | 204 | if (is_null($item)) { |
205 | - if (! $this->isTaggable()) { |
|
205 | + if (!$this->isTaggable()) { |
|
206 | 206 | continue; |
207 | 207 | } |
208 | 208 |
@@ -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 |
@@ -104,15 +104,15 @@ |
||
104 | 104 | $from = $this->from->parseValue($from); |
105 | 105 | $to = $this->to->parseValue($to); |
106 | 106 | |
107 | - if (! empty($from) && ! empty($to)) { |
|
107 | + if (!empty($from) && !empty($to)) { |
|
108 | 108 | $this->setOperator('between'); |
109 | 109 | |
110 | 110 | return [$from, $to]; |
111 | - } elseif (! empty($from)) { |
|
111 | + } elseif (!empty($from)) { |
|
112 | 112 | $this->setOperator('greater_or_equal'); |
113 | 113 | |
114 | 114 | return $from; |
115 | - } elseif (! empty($to)) { |
|
115 | + } elseif (!empty($to)) { |
|
116 | 116 | $this->setOperator('less_or_equal'); |
117 | 117 | |
118 | 118 | return $to; |
@@ -119,7 +119,7 @@ |
||
119 | 119 | $fieldName = array_pop($parts); |
120 | 120 | $relationName = implode('.', $parts); |
121 | 121 | |
122 | - $query->whereHas($relationName, function ($q) use ($queryString, $fieldName) { |
|
122 | + $query->whereHas($relationName, function($q) use ($queryString, $fieldName) { |
|
123 | 123 | $this->buildQuery($q, $fieldName, $queryString); |
124 | 124 | }); |
125 | 125 | } else { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $this->setModelForOptions($options); |
53 | 53 | } |
54 | 54 | |
55 | - if (! is_null($title)) { |
|
55 | + if (!is_null($title)) { |
|
56 | 56 | $this->setDisplay($title); |
57 | 57 | } |
58 | 58 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if ($this->multiple) { |
78 | 78 | $this->setHtmlAttribute('multiple', 'multiple'); |
79 | 79 | |
80 | - if (! in_array($this->operator, ['in', 'not_in'])) { |
|
80 | + if (!in_array($this->operator, ['in', 'not_in'])) { |
|
81 | 81 | $this->setOperator('in'); |
82 | 82 | } |
83 | 83 | } else { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function getOptions() |
123 | 123 | { |
124 | - if (! is_null($this->getModelForOptions()) and ! is_null($this->getDisplay())) { |
|
124 | + if (!is_null($this->getModelForOptions()) and !is_null($this->getDisplay())) { |
|
125 | 125 | $this->setOptions( |
126 | 126 | $this->loadOptions() |
127 | 127 | ); |