@@ -26,16 +26,16 @@ discard block |
||
26 | 26 | { |
27 | 27 | $routeName = 'admin.form.element.'.static::$route; |
28 | 28 | |
29 | - if (! $router->has($routeName)) { |
|
30 | - $router->post('{adminModel}/'.static::$route.'/{field}/{id?}', ['as' => $routeName, function ( |
|
29 | + if (!$router->has($routeName)) { |
|
30 | + $router->post('{adminModel}/'.static::$route.'/{field}/{id?}', [ 'as' => $routeName, function( |
|
31 | 31 | Request $request, |
32 | 32 | ModelConfigurationInterface $model, |
33 | 33 | $field, |
34 | 34 | $id = null |
35 | 35 | ) { |
36 | - if (! is_null($id)) { |
|
36 | + if (!is_null($id)) { |
|
37 | 37 | $item = $model->getRepository()->find($id); |
38 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
38 | + if (is_null($item) || !$model->isEditable($item)) { |
|
39 | 39 | return new JsonResponse([ |
40 | 40 | 'message' => trans('lang.message.access_denied'), |
41 | 41 | ], 403); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $form = $model->fireEdit($id); |
45 | 45 | } else { |
46 | - if (! $model->isCreatable()) { |
|
46 | + if (!$model->isCreatable()) { |
|
47 | 47 | return new JsonResponse([ |
48 | 48 | 'message' => trans('lang.message.access_denied'), |
49 | 49 | ], 403); |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | $form = $model->fireCreate(); |
53 | 53 | } |
54 | 54 | |
55 | - $messages = []; |
|
56 | - $labels = []; |
|
55 | + $messages = [ ]; |
|
56 | + $labels = [ ]; |
|
57 | 57 | $rules = static::defaultUploadValidationRules(); |
58 | 58 | |
59 | - if (! is_null($element = $form->getElement($field))) { |
|
59 | + if (!is_null($element = $form->getElement($field))) { |
|
60 | 60 | $rules = $element->getUploadValidationRules(); |
61 | 61 | $messages = $element->getUploadValidationMessages(); |
62 | 62 | $labels = $element->getUploadValidationLabels(); |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | $file = $request->file('file'); |
77 | 77 | |
78 | 78 | /** @var File $element */ |
79 | - if (! is_null($element = $form->getElement($field))) { |
|
79 | + if (!is_null($element = $form->getElement($field))) { |
|
80 | 80 | $filename = $element->getUploadFileName($file); |
81 | 81 | $path = $element->getUploadPath($file); |
82 | 82 | $settings = $element->getUploadSettings(); |
83 | 83 | } else { |
84 | 84 | $filename = static::defaultUploadFilename($file); |
85 | 85 | $path = static::defaultUploadPath($file); |
86 | - $settings = []; |
|
86 | + $settings = [ ]; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | static::saveFile($file, public_path($path), $filename, $settings); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | 'url' => asset($value), |
95 | 95 | 'value' => $value, |
96 | 96 | ]); |
97 | - }]); |
|
97 | + } ]); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | protected static function defaultUploadValidationRules() |
143 | 143 | { |
144 | 144 | return [ |
145 | - 'file' => ['required', 'file'], |
|
145 | + 'file' => [ 'required', 'file' ], |
|
146 | 146 | ]; |
147 | 147 | } |
148 | 148 | |
@@ -159,21 +159,21 @@ discard block |
||
159 | 159 | /** |
160 | 160 | * @var array |
161 | 161 | */ |
162 | - protected $uploadSettings = []; |
|
162 | + protected $uploadSettings = [ ]; |
|
163 | 163 | |
164 | 164 | /** |
165 | 165 | * @var array |
166 | 166 | */ |
167 | - protected $uploadValidationRules = ['required', 'file']; |
|
167 | + protected $uploadValidationRules = [ 'required', 'file' ]; |
|
168 | 168 | |
169 | 169 | /** |
170 | 170 | * @return array |
171 | 171 | */ |
172 | 172 | public function getUploadValidationMessages() |
173 | 173 | { |
174 | - $messages = []; |
|
174 | + $messages = [ ]; |
|
175 | 175 | foreach ($this->validationMessages as $rule => $message) { |
176 | - $messages["file.{$rule}"] = $message; |
|
176 | + $messages[ "file.{$rule}" ] = $message; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | return $messages; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function getUploadValidationLabels() |
186 | 186 | { |
187 | - return ['file' => $this->getLabel()]; |
|
187 | + return [ 'file' => $this->getLabel() ]; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function getUploadValidationRules() |
194 | 194 | { |
195 | - return ['file' => array_unique($this->uploadValidationRules)]; |
|
195 | + return [ 'file' => array_unique($this->uploadValidationRules) ]; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | */ |
203 | 203 | public function getUploadPath(UploadedFile $file) |
204 | 204 | { |
205 | - if (! is_callable($this->uploadPath)) { |
|
205 | + if (!is_callable($this->uploadPath)) { |
|
206 | 206 | return static::defaultUploadPath($file); |
207 | 207 | } |
208 | 208 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | */ |
229 | 229 | public function getUploadFileName(UploadedFile $file) |
230 | 230 | { |
231 | - if (! is_callable($this->uploadFileName)) { |
|
231 | + if (!is_callable($this->uploadFileName)) { |
|
232 | 232 | return static::defaultUploadFilename($file); |
233 | 233 | } |
234 | 234 | |
@@ -279,11 +279,11 @@ discard block |
||
279 | 279 | */ |
280 | 280 | public function addValidationRule($rule, $message = null) |
281 | 281 | { |
282 | - $uploadRules = ['file', 'image', 'mime', 'size', 'dimensions', 'max', 'min', 'between']; |
|
282 | + $uploadRules = [ 'file', 'image', 'mime', 'size', 'dimensions', 'max', 'min', 'between' ]; |
|
283 | 283 | |
284 | 284 | foreach ($uploadRules as $uploadRule) { |
285 | 285 | if (strpos($rule, $uploadRule) !== false) { |
286 | - $this->uploadValidationRules[] = $rule; |
|
286 | + $this->uploadValidationRules[ ] = $rule; |
|
287 | 287 | |
288 | 288 | if (is_null($message)) { |
289 | 289 | return $this; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * @var array |
25 | 25 | */ |
26 | - protected $options = []; |
|
26 | + protected $options = [ ]; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * @var bool |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | /** |
44 | 44 | * @var array |
45 | 45 | */ |
46 | - protected $exclude = []; |
|
46 | + protected $exclude = [ ]; |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * @var string|null |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | /** |
54 | 54 | * @var array |
55 | 55 | */ |
56 | - protected $fetchColumns = []; |
|
56 | + protected $fetchColumns = [ ]; |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * @var function|\Closure|object callable |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @param string|null $label |
66 | 66 | * @param array|Model $options |
67 | 67 | */ |
68 | - public function __construct($path, $label = null, $options = []) |
|
68 | + public function __construct($path, $label = null, $options = [ ]) |
|
69 | 69 | { |
70 | 70 | parent::__construct($path, $label); |
71 | 71 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $modelForOptions = app($modelForOptions); |
97 | 97 | } |
98 | 98 | |
99 | - if (! ($modelForOptions instanceof Model)) { |
|
99 | + if (!($modelForOptions instanceof Model)) { |
|
100 | 100 | throw new SelectException('Class must be instanced of Illuminate\Database\Eloquent\Model'); |
101 | 101 | } |
102 | 102 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function getOptions() |
132 | 132 | { |
133 | - if (! is_null($this->getModelForOptions()) && ! is_null($this->getDisplay())) { |
|
133 | + if (!is_null($this->getModelForOptions()) && !is_null($this->getDisplay())) { |
|
134 | 134 | $this->loadOptions(); |
135 | 135 | } |
136 | 136 | |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function setFetchColumns($columns) |
239 | 239 | { |
240 | - if (! is_array($columns)) { |
|
240 | + if (!is_array($columns)) { |
|
241 | 241 | $columns = func_get_args(); |
242 | 242 | } |
243 | 243 | |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | */ |
299 | 299 | public function exclude($keys) |
300 | 300 | { |
301 | - if (! is_array($keys)) { |
|
301 | + if (!is_array($keys)) { |
|
302 | 302 | $keys = func_get_args(); |
303 | 303 | } |
304 | 304 | |
@@ -344,14 +344,14 @@ discard block |
||
344 | 344 | ]; |
345 | 345 | |
346 | 346 | if ($this->isReadonly()) { |
347 | - $attributes['disabled'] = 'disabled'; |
|
347 | + $attributes[ 'disabled' ] = 'disabled'; |
|
348 | 348 | } |
349 | 349 | |
350 | 350 | $options = $this->getOptions(); |
351 | 351 | |
352 | 352 | if ($this->isNullable()) { |
353 | - $attributes['data-nullable'] = 'true'; |
|
354 | - $options = [null => trans('sleeping_owl::lang.select.nothing')] + $options; |
|
353 | + $attributes[ 'data-nullable' ] = 'true'; |
|
354 | + $options = [ null => trans('sleeping_owl::lang.select.nothing') ] + $options; |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | $options = array_except($options, $this->exclude); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | */ |
369 | 369 | protected function loadOptions() |
370 | 370 | { |
371 | - $repository = app(RepositoryInterface::class, [$this->getModelForOptions()]); |
|
371 | + $repository = app(RepositoryInterface::class, [ $this->getModelForOptions() ]); |
|
372 | 372 | |
373 | 373 | $key = $repository->getModel()->getKeyName(); |
374 | 374 | |
@@ -379,12 +379,12 @@ discard block |
||
379 | 379 | } |
380 | 380 | |
381 | 381 | if (count($this->fetchColumns) > 0) { |
382 | - $columns = array_merge([$key], $this->fetchColumns); |
|
382 | + $columns = array_merge([ $key ], $this->fetchColumns); |
|
383 | 383 | $options->select($columns); |
384 | 384 | } |
385 | 385 | |
386 | 386 | // call the pre load options query preparer if has be set |
387 | - if (! is_null($preparer = $this->getLoadOptionsQueryPreparer())) { |
|
387 | + if (!is_null($preparer = $this->getLoadOptionsQueryPreparer())) { |
|
388 | 388 | $options = $preparer($this, $options); |
389 | 389 | } |
390 | 390 | |
@@ -401,9 +401,9 @@ discard block |
||
401 | 401 | |
402 | 402 | // iterate for all options and redefine it as |
403 | 403 | // list of KEY and TEXT pair |
404 | - $options = array_map(function ($opt) use ($key, $makeDisplay) { |
|
404 | + $options = array_map(function($opt) use ($key, $makeDisplay) { |
|
405 | 405 | // get the KEY and make the display text |
406 | - return [data_get($opt, $key), $makeDisplay($opt)]; |
|
406 | + return [ data_get($opt, $key), $makeDisplay($opt) ]; |
|
407 | 407 | }, $options); |
408 | 408 | |
409 | 409 | // take options as array with KEY => VALUE pair |
@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | { |
56 | 56 | $this->content = $content; |
57 | 57 | |
58 | - if (! is_null($label)) { |
|
58 | + if (!is_null($label)) { |
|
59 | 59 | $this->setLabel($label); |
60 | 60 | } |
61 | 61 | |
62 | - if (! is_null($icon)) { |
|
62 | + if (!is_null($icon)) { |
|
63 | 63 | $this->setIcon($icon); |
64 | 64 | } |
65 | 65 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | return $this->getContent()->getValidationRules(); |
308 | 308 | } |
309 | 309 | |
310 | - return []; |
|
310 | + return [ ]; |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | return $this->getContent()->getValidationMessages(); |
320 | 320 | } |
321 | 321 | |
322 | - return []; |
|
322 | + return [ ]; |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | return $this->getContent()->getValidationLabels(); |
332 | 332 | } |
333 | 333 | |
334 | - return []; |
|
334 | + return [ ]; |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | /** |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function getDefaultFrom() |
29 | 29 | { |
30 | - if (! $this->defaultFrom) { |
|
30 | + if (!$this->defaultFrom) { |
|
31 | 31 | $this->defaultFrom = Carbon::now(); |
32 | 32 | } |
33 | 33 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function getDefaultTo() |
55 | 55 | { |
56 | - if (! $this->defaultTo) { |
|
56 | + if (!$this->defaultTo) { |
|
57 | 57 | $this->defaultTo = Carbon::now(); |
58 | 58 | } |
59 | 59 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function setValue(Model $model, $attribute, $value) |
83 | 83 | { |
84 | - $value = ! empty($value) ? array_map(function ($date) { |
|
84 | + $value = !empty($value) ? array_map(function($date) { |
|
85 | 85 | return Carbon::createFromFormat($this->getPickerFormat(), $date); |
86 | 86 | }, explode('::', $value)) : null; |
87 | 87 |
@@ -18,17 +18,17 @@ discard block |
||
18 | 18 | { |
19 | 19 | $routeName = 'admin.form.element.dependent-select'; |
20 | 20 | |
21 | - if (! $router->has($routeName)) { |
|
22 | - $router->post('{adminModel}/dependent-select/{field}/{id?}', ['as' => $routeName, function ( |
|
21 | + if (!$router->has($routeName)) { |
|
22 | + $router->post('{adminModel}/dependent-select/{field}/{id?}', [ 'as' => $routeName, function( |
|
23 | 23 | Request $request, |
24 | 24 | ModelConfigurationInterface $model, |
25 | 25 | $field, |
26 | 26 | $id = null |
27 | 27 | ) { |
28 | 28 | |
29 | - if (! is_null($id)) { |
|
29 | + if (!is_null($id)) { |
|
30 | 30 | $item = $model->getRepository()->find($id); |
31 | - if (is_null($item) || ! $model->isEditable($item)) { |
|
31 | + if (is_null($item) || !$model->isEditable($item)) { |
|
32 | 32 | return new JsonResponse([ |
33 | 33 | 'message' => trans('lang.message.access_denied'), |
34 | 34 | ], 403); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $form = $model->fireEdit($id); |
38 | 38 | } else { |
39 | - if (! $model->isCreatable()) { |
|
39 | + if (!$model->isCreatable()) { |
|
40 | 40 | return new JsonResponse([ |
41 | 41 | 'message' => trans('lang.message.access_denied'), |
42 | 42 | ], 403); |
@@ -52,24 +52,24 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | $element->setAjaxParameters( |
55 | - $request->input('depdrop_all_params', []) |
|
55 | + $request->input('depdrop_all_params', [ ]) |
|
56 | 56 | ); |
57 | 57 | |
58 | 58 | $options = $element->getOptions(); |
59 | 59 | |
60 | 60 | if ($element->isNullable()) { |
61 | - $options = [null => trans('sleeping_owl::lang.select.nothing')] + $options; |
|
61 | + $options = [ null => trans('sleeping_owl::lang.select.nothing') ] + $options; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $options = array_except($options, $element->exclude); |
65 | 65 | |
66 | 66 | return new JsonResponse([ |
67 | 67 | 'output' => collect($options)->map(function($value, $key) { |
68 | - return ['id' => $key, 'name' => $value]; |
|
68 | + return [ 'id' => $key, 'name' => $value ]; |
|
69 | 69 | }), |
70 | 70 | 'selected' => $element->getValue() |
71 | 71 | ]); |
72 | - }]); |
|
72 | + } ]); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | /** |
82 | 82 | * @var array |
83 | 83 | */ |
84 | - protected $dataDepends = []; |
|
84 | + protected $dataDepends = [ ]; |
|
85 | 85 | |
86 | 86 | /** |
87 | 87 | * @var array |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | * @param null $label |
96 | 96 | * @param array $depends |
97 | 97 | */ |
98 | - public function __construct($path, $label = null, array $depends = []) |
|
98 | + public function __construct($path, $label = null, array $depends = [ ]) |
|
99 | 99 | { |
100 | - parent::__construct($path, $label, []); |
|
100 | + parent::__construct($path, $label, [ ]); |
|
101 | 101 | |
102 | 102 | $this->setDataDepends($depends); |
103 | 103 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | ]; |
184 | 184 | |
185 | 185 | if ($this->isReadonly()) { |
186 | - $attributes['disabled'] = 'disabled'; |
|
186 | + $attributes[ 'disabled' ] = 'disabled'; |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | return [ |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | public function getValue() |
50 | 50 | { |
51 | 51 | $value = parent::getValue(); |
52 | - if (! empty($value)) { |
|
52 | + if (!empty($value)) { |
|
53 | 53 | return $this->parseValue($value); |
54 | 54 | } |
55 | 55 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function setValue(Model $model, $attribute, $value) |
83 | 83 | { |
84 | - $value = ! empty($value) ? Carbon::createFromFormat($this->getPickerFormat(), $value)->format($this->getFormat()) : null; |
|
84 | + $value = !empty($value) ? Carbon::createFromFormat($this->getPickerFormat(), $value)->format($this->getFormat()) : null; |
|
85 | 85 | |
86 | 86 | parent::setValue($model, $attribute, $value); |
87 | 87 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | public function storeAsJson() |
14 | 14 | { |
15 | - $this->mutateValue(function ($value) { |
|
15 | + $this->mutateValue(function($value) { |
|
16 | 16 | return json_encode($value); |
17 | 17 | }); |
18 | 18 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function storeAsComaSeparatedValue() |
28 | 28 | { |
29 | - $this->mutateValue(function ($value) { |
|
29 | + $this->mutateValue(function($value) { |
|
30 | 30 | return implode(',', $value); |
31 | 31 | }); |
32 | 32 | |
@@ -38,13 +38,13 @@ discard block |
||
38 | 38 | $name = $this->getName(); |
39 | 39 | $value = Request::input($name, ''); |
40 | 40 | |
41 | - if (! empty($value)) { |
|
41 | + if (!empty($value)) { |
|
42 | 42 | $value = explode(',', $value); |
43 | 43 | } else { |
44 | - $value = []; |
|
44 | + $value = [ ]; |
|
45 | 45 | } |
46 | 46 | |
47 | - Request::merge([$name => $value]); |
|
47 | + Request::merge([ $name => $value ]); |
|
48 | 48 | parent::save(); |
49 | 49 | } |
50 | 50 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | $value = parent::getValue(); |
57 | 57 | if (is_null($value)) { |
58 | - $value = []; |
|
58 | + $value = [ ]; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | if (is_string($value)) { |
@@ -96,11 +96,11 @@ discard block |
||
96 | 96 | ]; |
97 | 97 | |
98 | 98 | if ($this->isTaggable()) { |
99 | - $attributes['class'] .= ' input-taggable'; |
|
99 | + $attributes[ 'class' ] .= ' input-taggable'; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | if ($this->isReadonly()) { |
103 | - $attributes['disabled'] = 'disabled'; |
|
103 | + $attributes[ 'disabled' ] = 'disabled'; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | return [ |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $attribute = $this->getAttribute(); |
126 | 126 | |
127 | 127 | if (is_null(Request::input($this->getPath()))) { |
128 | - $values = []; |
|
128 | + $values = [ ]; |
|
129 | 129 | } else { |
130 | 130 | $values = $this->getValue(); |
131 | 131 | } |
@@ -134,19 +134,19 @@ discard block |
||
134 | 134 | |
135 | 135 | if ($relation instanceof \Illuminate\Database\Eloquent\Relations\BelongsToMany) { |
136 | 136 | foreach ($values as $i => $value) { |
137 | - if (! array_key_exists($value, $this->getOptions()) and $this->isTaggable()) { |
|
137 | + if (!array_key_exists($value, $this->getOptions()) and $this->isTaggable()) { |
|
138 | 138 | $model = clone $this->getModelForOptions(); |
139 | 139 | $model->{$this->getDisplay()} = $value; |
140 | 140 | $model->save(); |
141 | 141 | |
142 | - $values[$i] = $model->getKey(); |
|
142 | + $values[ $i ] = $model->getKey(); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
146 | 146 | $relation->sync($values); |
147 | 147 | } elseif ($relation instanceof \Illuminate\Database\Eloquent\Relations\HasMany) { |
148 | 148 | foreach ($relation->get() as $item) { |
149 | - if (! in_array($item->getKey(), $values)) { |
|
149 | + if (!in_array($item->getKey(), $values)) { |
|
150 | 150 | if ($this->isDeleteRelatedItem()) { |
151 | 151 | $item->delete(); |
152 | 152 | } else { |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $item = $model->find($value); |
163 | 163 | |
164 | 164 | if (is_null($item)) { |
165 | - if (! $this->isTaggable()) { |
|
165 | + if (!$this->isTaggable()) { |
|
166 | 166 | continue; |
167 | 167 | } |
168 | 168 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | $value = $this->getValue(); |
15 | 15 | |
16 | - if (! $this->isAllowedEmptyValue() and $this->getModel()->exists() and empty($value)) { |
|
16 | + if (!$this->isAllowedEmptyValue() and $this->getModel()->exists() and empty($value)) { |
|
17 | 17 | return; |
18 | 18 | } |
19 | 19 | |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | { |
28 | 28 | $data = parent::getValidationRules(); |
29 | 29 | |
30 | - if (! $this->isAllowedEmptyValue() and $this->getModel()->exists()) { |
|
30 | + if (!$this->isAllowedEmptyValue() and $this->getModel()->exists()) { |
|
31 | 31 | foreach ($data as $field => $rules) { |
32 | 32 | foreach ($rules as $i => $rule) { |
33 | 33 | if ($rule == 'required') { |
34 | - unset($data[$field][$i]); |
|
34 | + unset($data[ $field ][ $i ]); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function hashWithBcrypt() |
65 | 65 | { |
66 | - return $this->mutateValue(function ($value) { |
|
66 | + return $this->mutateValue(function($value) { |
|
67 | 67 | return bcrypt($value); |
68 | 68 | }); |
69 | 69 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function hashWithMD5() |
75 | 75 | { |
76 | - return $this->mutateValue(function ($value) { |
|
76 | + return $this->mutateValue(function($value) { |
|
77 | 77 | return md5($value); |
78 | 78 | }); |
79 | 79 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function hashWithSHA1() |
85 | 85 | { |
86 | - return $this->mutateValue(function ($value) { |
|
86 | + return $this->mutateValue(function($value) { |
|
87 | 87 | return sha1($value); |
88 | 88 | }); |
89 | 89 | } |