Completed
Pull Request — master (#3101)
by Robin
02:50
created
src/Form.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
      */
325 325
     public function destroy($id)
326 326
     {
327
-        collect(explode(',', $id))->filter()->each(function ($id) {
327
+        collect(explode(',', $id))->filter()->each(function($id) {
328 328
             $builder = $this->model()->newQuery();
329 329
 
330 330
             if ($this->isSoftDeletes) {
@@ -362,9 +362,9 @@  discard block
 block discarded – undo
362 362
 
363 363
         $data = $model->toArray();
364 364
 
365
-        $this->builder->fields()->filter(function ($field) {
365
+        $this->builder->fields()->filter(function($field) {
366 366
             return $field instanceof Field\File;
367
-        })->each(function (Field\File $file) use ($data) {
367
+        })->each(function(Field\File $file) use ($data) {
368 368
             $file->setOriginal($data);
369 369
 
370 370
             $file->destroy();
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
             return $response;
390 390
         }
391 391
 
392
-        DB::transaction(function () {
392
+        DB::transaction(function() {
393 393
             $inserts = $this->prepareInsert($this->updates);
394 394
 
395 395
             foreach ($inserts as $column => $value) {
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
             return $response;
599 599
         }
600 600
 
601
-        DB::transaction(function () {
601
+        DB::transaction(function() {
602 602
             $updates = $this->prepareUpdate($this->updates);
603 603
 
604 604
             foreach ($updates as $column => $value) {
@@ -662,13 +662,13 @@  discard block
 block discarded – undo
662 662
     {
663 663
         if (request('after-save') == 1) {
664 664
             // continue editing
665
-            $url = rtrim($resourcesPath, '/') . "/{$key}/edit";
665
+            $url = rtrim($resourcesPath, '/')."/{$key}/edit";
666 666
         } elseif (request('after-save') == 2) {
667 667
             // continue creating
668
-            $url = rtrim($resourcesPath, '/') . '/create';
668
+            $url = rtrim($resourcesPath, '/').'/create';
669 669
         } elseif (request('after-save') == 3) {
670 670
             // view resource
671
-            $url = rtrim($resourcesPath, '/') . "/{$key}";
671
+            $url = rtrim($resourcesPath, '/')."/{$key}";
672 672
         } else {
673 673
             $url = request(Builder::PREVIOUS_URL_KEY) ?: $resourcesPath;
674 674
         }
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
      */
914 914
     protected function invalidColumn($columns, $oneToOneRelation = false)
915 915
     {
916
-        foreach ((array)$columns as $column) {
916
+        foreach ((array) $columns as $column) {
917 917
             if (
918 918
                 (!$oneToOneRelation && Str::contains($column, '.')) || ($oneToOneRelation && !Str::contains($column, '.'))
919 919
             ) {
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
      */
1036 1036
     public function ignore($fields)
1037 1037
     {
1038
-        $this->ignored = array_merge($this->ignored, (array)$fields);
1038
+        $this->ignored = array_merge($this->ignored, (array) $fields);
1039 1039
 
1040 1040
         return $this;
1041 1041
     }
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
     protected function getFieldByColumn($column)
1076 1076
     {
1077 1077
         return $this->builder->fields()->first(
1078
-            function (Field $field) use ($column) {
1078
+            function(Field $field) use ($column) {
1079 1079
                 if (is_array($field->column())) {
1080 1080
                     return in_array($column, $field->column());
1081 1081
                 }
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
 
1097 1097
         $values = $this->model->toArray();
1098 1098
 
1099
-        $this->builder->fields()->each(function (Field $field) use ($values) {
1099
+        $this->builder->fields()->each(function(Field $field) use ($values) {
1100 1100
             $field->setOriginal($values);
1101 1101
         });
1102 1102
     }
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
 
1127 1127
         $data = $this->model->toArray();
1128 1128
 
1129
-        $this->builder->fields()->each(function (Field $field) use ($data) {
1129
+        $this->builder->fields()->each(function(Field $field) use ($data) {
1130 1130
             if (!in_array($field->column(), $this->ignored)) {
1131 1131
                 $field->fill($data);
1132 1132
             }
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
      */
1252 1252
     public function setWidth($fieldWidth = 8, $labelWidth = 2)
1253 1253
     {
1254
-        $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) {
1254
+        $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) {
1255 1255
             /* @var Field $field  */
1256 1256
             $field->setWidth($fieldWidth, $labelWidth);
1257 1257
         });
Please login to merge, or discard this patch.