@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | | |
46 | 46 | */ |
47 | 47 | |
48 | - 'middleware' => ['web'], |
|
48 | + 'middleware' => [ 'web' ], |
|
49 | 49 | |
50 | 50 | /* |
51 | 51 | |-------------------------------------------------------------------------- |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * See https://github.com/NextStepWebs/simplemde-markdown-editor |
134 | 134 | */ |
135 | 135 | 'simplemde' => [ |
136 | - 'hideIcons' => ['side-by-side', 'fullscreen'], |
|
136 | + 'hideIcons' => [ 'side-by-side', 'fullscreen' ], |
|
137 | 137 | ], |
138 | 138 | ], |
139 | 139 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | | Select default settings for datatable |
146 | 146 | | |
147 | 147 | */ |
148 | - 'datatables' => [], |
|
148 | + 'datatables' => [ ], |
|
149 | 149 | |
150 | 150 | /* |
151 | 151 | |-------------------------------------------------------------------------- |
@@ -62,6 +62,6 @@ |
||
62 | 62 | | |
63 | 63 | */ |
64 | 64 | |
65 | - 'attributes' => [], |
|
65 | + 'attributes' => [ ], |
|
66 | 66 | |
67 | 67 | ]; |
@@ -87,6 +87,6 @@ |
||
87 | 87 | | |
88 | 88 | */ |
89 | 89 | |
90 | - 'attributes' => [], |
|
90 | + 'attributes' => [ ], |
|
91 | 91 | |
92 | 92 | ]; |
@@ -87,6 +87,6 @@ |
||
87 | 87 | | |
88 | 88 | */ |
89 | 89 | |
90 | - 'attributes' => [], |
|
90 | + 'attributes' => [ ], |
|
91 | 91 | |
92 | 92 | ]; |
@@ -87,6 +87,6 @@ |
||
87 | 87 | | |
88 | 88 | */ |
89 | 89 | |
90 | - 'attributes' => [], |
|
90 | + 'attributes' => [ ], |
|
91 | 91 | |
92 | 92 | ]; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * @var array |
57 | 57 | */ |
58 | - protected $validationMessages = []; |
|
58 | + protected $validationMessages = [ ]; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * @param string $path |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | { |
85 | 85 | $name = array_shift($parts); |
86 | 86 | |
87 | - while (! empty($parts)) { |
|
87 | + while (!empty($parts)) { |
|
88 | 88 | $part = array_shift($parts); |
89 | 89 | $name .= "[$part]"; |
90 | 90 | } |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $messages = parent::getValidationMessages(); |
290 | 290 | |
291 | 291 | foreach ($this->validationMessages as $rule => $message) { |
292 | - $messages[$this->getName().'.'.$rule] = $message; |
|
292 | + $messages[ $this->getName().'.'.$rule ] = $message; |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | return $messages; |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | */ |
316 | 316 | public function addValidationMessage($rule, $message) |
317 | 317 | { |
318 | - $this->validationMessages[$rule] = $message; |
|
318 | + $this->validationMessages[ $rule ] = $message; |
|
319 | 319 | |
320 | 320 | return $this; |
321 | 321 | } |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | */ |
326 | 326 | public function getValidationLabels() |
327 | 327 | { |
328 | - return [$this->getPath() => $this->getLabel()]; |
|
328 | + return [ $this->getPath() => $this->getLabel() ]; |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | /** |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | */ |
335 | 335 | public function getValue() |
336 | 336 | { |
337 | - if (! is_null($value = Request::old($this->getPath()))) { |
|
337 | + if (!is_null($value = Request::old($this->getPath()))) { |
|
338 | 338 | return $value; |
339 | 339 | } |
340 | 340 | |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $model = $this->getModel(); |
349 | 349 | $value = $this->getDefaultValue(); |
350 | 350 | |
351 | - if (is_null($model) or ! $model->exists) { |
|
351 | + if (is_null($model) or !$model->exists) { |
|
352 | 352 | return $value; |
353 | 353 | } |
354 | 354 | |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $count = count($relations); |
357 | 357 | |
358 | 358 | if ($count === 1) { |
359 | - if($value){ |
|
359 | + if ($value) { |
|
360 | 360 | return $value; |
361 | 361 | } |
362 | 362 | return $model->getAttribute($this->getAttribute()); |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | } |
405 | 405 | unset($rule); |
406 | 406 | |
407 | - return [$this->getPath() => $rules]; |
|
407 | + return [ $this->getPath() => $rules ]; |
|
408 | 408 | } |
409 | 409 | |
410 | 410 | /** |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | public static function registerRoutes() |
19 | 19 | { |
20 | 20 | $routeName = 'admin.form.element.file.'.static::$route; |
21 | - if (! Route::has($routeName)) { |
|
22 | - Route::post('FormElements/image/'.static::$route, ['as' => $routeName, function () { |
|
21 | + if (!Route::has($routeName)) { |
|
22 | + Route::post('FormElements/image/'.static::$route, [ 'as' => $routeName, function() { |
|
23 | 23 | $validator = Validator::make(Request::all(), static::uploadValidationRules()); |
24 | 24 | |
25 | 25 | static::uploadValidationRules($validator); |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | $fullPath = public_path($path); |
35 | 35 | |
36 | 36 | $value = $path.'/'.$filename; |
37 | - $envFile = config('filesystems.default', 'local')=='local'; |
|
38 | - if($envFile){ |
|
37 | + $envFile = config('filesystems.default', 'local') == 'local'; |
|
38 | + if ($envFile) { |
|
39 | 39 | $move2Path = $file->move($fullPath, $filename); |
40 | 40 | $value = $path.'/'.$filename; |
41 | - }else{ |
|
41 | + } else { |
|
42 | 42 | $move2Path = \Storage::put( |
43 | 43 | $value, |
44 | 44 | file_get_contents($file->getRealPath())// |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | return Response::make($validator->errors()->get('file'), 400); |
49 | 49 | } |
50 | 50 | return [ |
51 | - 'url' => $envFile?asset($value):'http://'.config('filesystems.disks.'.config('filesystems.default').'.domain').'/'.$value, |
|
51 | + 'url' => $envFile ? asset($value) : 'http://'.config('filesystems.disks.'.config('filesystems.default').'.domain').'/'.$value, |
|
52 | 52 | 'value' => $value, |
53 | 53 | ]; |
54 | - }]); |
|
54 | + } ]); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | $this->initialized = true; |
92 | - $this->repository = app(RepositoryInterface::class, [$this->class]); |
|
92 | + $this->repository = app(RepositoryInterface::class, [ $this->class ]); |
|
93 | 93 | |
94 | 94 | $this->setModel(app($this->class)); |
95 | 95 | |
96 | 96 | parent::initialize(); |
97 | 97 | |
98 | - $this->getElements()->each(function ($element) { |
|
99 | - if ($element instanceof Upload and ! $this->hasHtmlAttribute('enctype')) { |
|
98 | + $this->getElements()->each(function($element) { |
|
99 | + if ($element instanceof Upload and !$this->hasHtmlAttribute('enctype')) { |
|
100 | 100 | $this->setHtmlAttribute('enctype', 'multipart/form-data'); |
101 | 101 | } |
102 | 102 | }); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | public function setItems($items) |
226 | 226 | { |
227 | - if (! is_array($items)) { |
|
227 | + if (!is_array($items)) { |
|
228 | 228 | $items = func_get_args(); |
229 | 229 | } |
230 | 230 |