@@ -328,9 +328,9 @@ discard block |
||
328 | 328 | $data = $this->model->with($this->getRelations()) |
329 | 329 | ->findOrFail($id)->toArray(); |
330 | 330 | |
331 | - $this->builder->fields()->filter(function ($field) { |
|
331 | + $this->builder->fields()->filter(function($field) { |
|
332 | 332 | return $field instanceof Field\File; |
333 | - })->each(function (File $file) use ($data) { |
|
333 | + })->each(function(File $file) use ($data) { |
|
334 | 334 | $file->setOriginal($data); |
335 | 335 | |
336 | 336 | $file->destroy(); |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | return $response; |
356 | 356 | } |
357 | 357 | |
358 | - DB::transaction(function () { |
|
358 | + DB::transaction(function() { |
|
359 | 359 | $inserts = $this->prepareInsert($this->updates); |
360 | 360 | |
361 | 361 | foreach ($inserts as $column => $value) { |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | return $response; |
560 | 560 | } |
561 | 561 | |
562 | - DB::transaction(function () { |
|
562 | + DB::transaction(function() { |
|
563 | 563 | $updates = $this->prepareUpdate($this->updates); |
564 | 564 | |
565 | 565 | foreach ($updates as $column => $value) { |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | */ |
808 | 808 | protected function invalidColumn($columns, $oneToOneRelation = false) |
809 | 809 | { |
810 | - foreach ((array)$columns as $column) { |
|
810 | + foreach ((array) $columns as $column) { |
|
811 | 811 | if ((!$oneToOneRelation && Str::contains($column, '.')) || |
812 | 812 | ($oneToOneRelation && !Str::contains($column, '.')) |
813 | 813 | ) { |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | */ |
917 | 917 | public function ignore($fields) |
918 | 918 | { |
919 | - $this->ignored = array_merge($this->ignored, (array)$fields); |
|
919 | + $this->ignored = array_merge($this->ignored, (array) $fields); |
|
920 | 920 | |
921 | 921 | return $this; |
922 | 922 | } |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | protected function getFieldByColumn($column) |
957 | 957 | { |
958 | 958 | return $this->builder->fields()->first( |
959 | - function (Field $field) use ($column) { |
|
959 | + function(Field $field) use ($column) { |
|
960 | 960 | if (is_array($field->column())) { |
961 | 961 | return in_array($column, $field->column()); |
962 | 962 | } |
@@ -977,7 +977,7 @@ discard block |
||
977 | 977 | |
978 | 978 | $values = $this->model->toArray(); |
979 | 979 | |
980 | - $this->builder->fields()->each(function (Field $field) use ($values) { |
|
980 | + $this->builder->fields()->each(function(Field $field) use ($values) { |
|
981 | 981 | $field->setOriginal($values); |
982 | 982 | }); |
983 | 983 | } |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | |
1000 | 1000 | $data = $this->model->toArray(); |
1001 | 1001 | |
1002 | - $this->builder->fields()->each(function (Field $field) use ($data) { |
|
1002 | + $this->builder->fields()->each(function(Field $field) use ($data) { |
|
1003 | 1003 | $field->fill($data); |
1004 | 1004 | }); |
1005 | 1005 | } |
@@ -1118,7 +1118,7 @@ discard block |
||
1118 | 1118 | */ |
1119 | 1119 | public function setWidth($fieldWidth = 8, $labelWidth = 2) |
1120 | 1120 | { |
1121 | - $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
1121 | + $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) { |
|
1122 | 1122 | /* @var Field $field */ |
1123 | 1123 | $field->setWidth($fieldWidth, $labelWidth); |
1124 | 1124 | }); |
@@ -254,10 +254,10 @@ discard block |
||
254 | 254 | * @internal param mixed $val |
255 | 255 | * |
256 | 256 | */ |
257 | - public function addButton($text, $btn_url ,$ajax_url) |
|
257 | + public function addButton($text, $btn_url, $ajax_url) |
|
258 | 258 | { |
259 | 259 | $this->button['text'] = $text; |
260 | - $this->button['class'] = $this->getElementClassString() . "_btn"; |
|
260 | + $this->button['class'] = $this->getElementClassString()."_btn"; |
|
261 | 261 | $this->button['script'] = <<<EOT |
262 | 262 | $(".{$this->button['class']}").on("click",function(){ |
263 | 263 | window.open("{$btn_url}") |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | $configs = json_encode($configs); |
298 | 298 | |
299 | 299 | if (empty($this->script)) { |
300 | - $this->script = "$(\"{$this->getElementClassSelector()}\").select2($configs);" . $this->button['script']; |
|
300 | + $this->script = "$(\"{$this->getElementClassSelector()}\").select2($configs);".$this->button['script']; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | if ($this->options instanceof \Closure) { |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | public function prependIcon($icon, $class = "") |
12 | 12 | { |
13 | 13 | if (is_null($this->prepend)) { |
14 | - $this->prepend = '<i class="fa fa-' . $icon . " " . $class . '"></i>'; |
|
14 | + $this->prepend = '<i class="fa fa-'.$icon." ".$class.'"></i>'; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | return $this; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | public function appendIcon($icon, $class = "") |
21 | 21 | { |
22 | 22 | if (is_null($this->append)) { |
23 | - $this->append = '<i class="fa fa-' . $icon . " " . $class . '"></i>'; |
|
23 | + $this->append = '<i class="fa fa-'.$icon." ".$class.'"></i>'; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | return $this; |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | $rules = $input = []; |
103 | 103 | |
104 | 104 | foreach ($value as $key => $file) { |
105 | - $rules[$this->column . $key] = $this->getRules(); |
|
106 | - $input[$this->column . $key] = $file; |
|
105 | + $rules[$this->column.$key] = $this->getRules(); |
|
106 | + $input[$this->column.$key] = $file; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | return [ |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | { |
157 | 157 | $this->name = $this->getStoreName($file); |
158 | 158 | |
159 | - return tap($this->upload($file), function () { |
|
159 | + return tap($this->upload($file), function() { |
|
160 | 160 | $this->name = null; |
161 | 161 | }); |
162 | 162 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $this->options(['contentsLangDirection' => 'ltr']); |
24 | 24 | $this->options(['language' => config('app.locale', 'en')]); |
25 | 25 | //for jquery validation |
26 | - $this->addElementClass(['validate','ckeditor']); |
|
26 | + $this->addElementClass(['validate', 'ckeditor']); |
|
27 | 27 | |
28 | 28 | } |
29 | 29 | |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | * @param string $dir |
37 | 37 | * @return $this |
38 | 38 | */ |
39 | - public function direction($dir ='ltr') |
|
39 | + public function direction($dir = 'ltr') |
|
40 | 40 | { |
41 | 41 | $this->options(['contentsLangDirection' => $dir]); |
42 | 42 | $this->direction = $dir; |
43 | 43 | |
44 | - return $this; } |
|
44 | + return $this; } |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * set language for editor |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public function setWidth($fieldWidth = 8, $labelWidth = 2) |
174 | 174 | { |
175 | - collect($this->fields)->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
175 | + collect($this->fields)->each(function($field) use ($fieldWidth, $labelWidth) { |
|
176 | 176 | /* @var Field $field */ |
177 | 177 | $field->setWidth($fieldWidth, $labelWidth); |
178 | 178 | }); |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | { |
342 | 342 | $rules = []; |
343 | 343 | foreach ($this->fields as $item) { |
344 | - if(!empty($item->getRules())){ |
|
344 | + if (!empty($item->getRules())) { |
|
345 | 345 | $rules[$item->id] = $item->getRules(); |
346 | 346 | } |
347 | 347 | } |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | public function getRuleMessages() |
358 | 358 | { |
359 | 359 | $rules = []; |
360 | - foreach ($this->fields as $item ) { |
|
360 | + foreach ($this->fields as $item) { |
|
361 | 361 | foreach ($item->validationMessages as $key => $value) { |
362 | 362 | $rules[$key] = $value; |
363 | 363 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * @param string $link |
26 | 26 | * @param string $info |
27 | 27 | */ |
28 | - public function __construct($name, $icon, $color, $link, $info, $more_text =null ) |
|
28 | + public function __construct($name, $icon, $color, $link, $info, $more_text = null) |
|
29 | 29 | { |
30 | 30 | if ($more_text == null) $more_text = trans('admin.more'); |
31 | 31 |