Completed
Push — master ( 3d1d4f...7dac91 )
by
unknown
05:13
created
src/Abstractor/Eloquent/Relation/Translation.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 
4 4
 use Anavel\Crud\Abstractor\Eloquent\Relation\Traits\CheckRelationCompatibility;
5 5
 use Anavel\Crud\Contracts\Abstractor\Field;
6
-use App;
7 6
 use Illuminate\Http\Request;
8 7
 
9 8
 class Translation extends Relation
Please login to merge, or discard this patch.
src/Abstractor/Eloquent/Model.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         if (!empty($customDisplayedColumns) && is_array($customDisplayedColumns)) {
135 135
             foreach ($customDisplayedColumns as $customColumn) {
136 136
                 if (!array_key_exists($customColumn, $tableColumns)) {
137
-                    throw new AbstractorException("Column " . $customColumn . " does not exist on " . $this->getModel());
137
+                    throw new AbstractorException("Column ".$customColumn." does not exist on ".$this->getModel());
138 138
                 }
139 139
 
140 140
                 $columns[$customColumn] = $tableColumns[$customColumn];
@@ -316,14 +316,14 @@  discard block
 block discarded – undo
316 316
                     $field = $this->fieldFactory
317 317
                         ->setColumn($column)
318 318
                         ->setConfig([
319
-                            'name' => $name . '__delete',
319
+                            'name' => $name.'__delete',
320 320
                             'presentation' => null,
321 321
                             'form_type' => 'checkbox',
322 322
                             'no_validate' => true,
323 323
                             'functions' => null
324 324
                         ])
325 325
                         ->get();
326
-                    $fields[$arrayKey][$name . '__delete'] = $field;
326
+                    $fields[$arrayKey][$name.'__delete'] = $field;
327 327
                 }
328 328
             }
329 329
         }
Please login to merge, or discard this patch.
src/Abstractor/Eloquent/Relation/MiniCrud.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
                 $config = [
125 125
                     'name' => $columnName,
126
-                    'presentation' => $this->name . ' ' . ucfirst(transcrud($columnName)),
126
+                    'presentation' => $this->name.' '.ucfirst(transcrud($columnName)),
127 127
                     'form_type' => $formType,
128 128
                     'no_validate' => true,
129 129
                     'validation' => null,
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                     $field = $this->fieldFactory
145 145
                         ->setColumn($column)
146 146
                         ->setConfig([
147
-                            'name' => $columnName . '__delete',
147
+                            'name' => $columnName.'__delete',
148 148
                             'presentation' => null,
149 149
                             'form_type' => 'checkbox',
150 150
                             'no_validate' => true,
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                             'functions' => null
153 153
                         ])
154 154
                         ->get();
155
-                    $fields[$columnName . '__delete'] = $field;
155
+                    $fields[$columnName.'__delete'] = $field;
156 156
                 }
157 157
             }
158 158
         }
@@ -196,11 +196,11 @@  discard block
 block discarded – undo
196 196
                     $fieldName = $field->getName();
197 197
 
198 198
                     if (get_class($field->getFormField()) === \FormManager\Fields\File::class) {
199
-                        $handleResult = $this->handleField($request, $relationModel, $relation, $this->name . ".$relationIndex", $fieldName);
200
-                        if (! empty($handleResult['skipNext'])) {
199
+                        $handleResult = $this->handleField($request, $relationModel, $relation, $this->name.".$relationIndex", $fieldName);
200
+                        if (!empty($handleResult['skipNext'])) {
201 201
                             unset($relationArray[$relationIndex][$handleResult['skipNext']]);
202 202
                         }
203
-                        if (! empty($handleResult['requestValue'])) {
203
+                        if (!empty($handleResult['requestValue'])) {
204 204
                             $relationArray[$relationIndex][$fieldName] = $handleResult['requestValue'];
205 205
                         }
206 206
                     }
Please login to merge, or discard this patch.
src/Abstractor/Eloquent/Traits/HandleFiles.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,18 +11,18 @@  discard block
 block discarded – undo
11 11
 {
12 12
     protected function handleField(Request $request, $item, array $fields, $groupName, $fieldName)
13 13
     {
14
-        $modelFolder = $this->slug . DIRECTORY_SEPARATOR;
14
+        $modelFolder = $this->slug.DIRECTORY_SEPARATOR;
15 15
         $basePath = base_path(config('anavel-crud.uploads_path'));
16
-        $modelPath = $basePath . $modelFolder;
16
+        $modelPath = $basePath.$modelFolder;
17 17
         $skip = null;
18 18
         $requestValue = null;
19
-        if (! empty($fields["{$fieldName}__delete"])) {
19
+        if (!empty($fields["{$fieldName}__delete"])) {
20 20
             //We never want to save this field, it doesn't exist in the DB
21 21
             $skip = "{$fieldName}__delete";
22 22
 
23 23
 
24 24
             //If user wants to delete the existing file
25
-            if (! empty($request->input("{$groupName}.{$fieldName}__delete"))) {
25
+            if (!empty($request->input("{$groupName}.{$fieldName}__delete"))) {
26 26
                 $adapter = new Local($basePath);
27 27
                 $filesystem = new Filesystem($adapter);
28 28
                 dd($item);
@@ -40,18 +40,18 @@  discard block
 block discarded – undo
40 40
                 ];
41 41
             }
42 42
         }
43
-        if ($request->hasFile($groupName .'.'.$fieldName)) {
44
-            $fileName = uniqid() . '.' . $request->file($groupName .'.'.$fieldName)->getClientOriginalExtension();
43
+        if ($request->hasFile($groupName.'.'.$fieldName)) {
44
+            $fileName = uniqid().'.'.$request->file($groupName.'.'.$fieldName)->getClientOriginalExtension();
45 45
 
46 46
 
47
-            $request->file($groupName .'.'.$fieldName)->move(
47
+            $request->file($groupName.'.'.$fieldName)->move(
48 48
                 $modelPath,
49 49
                 $fileName
50 50
             );
51 51
 
52
-            $requestValue = $modelFolder . $fileName;
53
-        } elseif (! empty($request->file($groupName .'.'.$fieldName)) && ! $request->file($groupName .'.'.$fieldName)->isValid()) {
54
-            throw new \Exception($request->file($groupName .'.'.$fieldName)->getErrorMessage());
52
+            $requestValue = $modelFolder.$fileName;
53
+        } elseif (!empty($request->file($groupName.'.'.$fieldName)) && !$request->file($groupName.'.'.$fieldName)->isValid()) {
54
+            throw new \Exception($request->file($groupName.'.'.$fieldName)->getErrorMessage());
55 55
         }
56 56
 
57 57
         return [
Please login to merge, or discard this patch.