Completed
Push — master ( c4c7fb...92582d )
by
unknown
06:02
created
src/View/Composers/SidebarComposer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                     }
53 53
                 }
54 54
                 // Remove empty groups (resulting, most probably, of different permissions)
55
-                if(count($menuItems[$group]['items']) < 1) {
55
+                if (count($menuItems[$group]['items']) < 1) {
56 56
                     unset($menuItems[$group]);
57 57
                 }
58 58
             }
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
             } catch (\Exception $e) {
65 65
                 continue;
66 66
             }
67
-            $menuItems[$modelName]['isActive'] =  $item['isActive'];
67
+            $menuItems[$modelName]['isActive'] = $item['isActive'];
68 68
             $menuItems[$modelName]['name'] = $item['name'];
69 69
             $menuItems[$modelName]['items'][] = $item;
70 70
         }
71 71
 
72 72
         //Sort alphabetically de menu items
73
-        usort($menuItems, function ($itemA, $itemB) {
73
+        usort($menuItems, function($itemA, $itemB) {
74 74
             return strcmp($itemA['name'], $itemB['name']);
75 75
         });
76 76
         return $menuItems;
Please login to merge, or discard this patch.
src/Abstractor/Eloquent/Traits/HandleFiles.php 1 patch
Spacing   +12 added lines, -12 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;
15
-        $basePath = base_path(DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR .config('anavel-crud.uploads_path'));
16
-        $modelPath = $basePath . $modelFolder;
14
+        $modelFolder = $this->slug.DIRECTORY_SEPARATOR;
15
+        $basePath = base_path(DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.config('anavel-crud.uploads_path'));
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
                 if ($filesystem->has($item->$fieldName)) {
@@ -39,22 +39,22 @@  discard block
 block discarded – undo
39 39
                 ];
40 40
             }
41 41
         }
42
-        if ($request->hasFile($groupName .'.'.$fieldName)) {
43
-            $fileName = uniqid() . '_' . slugify($request->file($groupName .'.'.$fieldName)->getClientOriginalName());
42
+        if ($request->hasFile($groupName.'.'.$fieldName)) {
43
+            $fileName = uniqid().'_'.slugify($request->file($groupName.'.'.$fieldName)->getClientOriginalName());
44 44
 
45 45
 
46
-            $request->file($groupName .'.'.$fieldName)->move(
46
+            $request->file($groupName.'.'.$fieldName)->move(
47 47
                 $modelPath,
48 48
                 $fileName
49 49
             );
50 50
 
51
-            $requestValue = $modelFolder . $fileName;
52
-        } elseif (! empty($request->file($groupName .'.'.$fieldName)) && ! $request->file($groupName .'.'.$fieldName)->isValid()) {
53
-            throw new \Exception($request->file($groupName .'.'.$fieldName)->getErrorMessage());
51
+            $requestValue = $modelFolder.$fileName;
52
+        } elseif (!empty($request->file($groupName.'.'.$fieldName)) && !$request->file($groupName.'.'.$fieldName)->isValid()) {
53
+            throw new \Exception($request->file($groupName.'.'.$fieldName)->getErrorMessage());
54 54
         }
55 55
 
56 56
         //Avoid losing the existing filename if the user doesn't change it:
57
-        if (empty($requestValue) && (! empty($item->$fieldName))) {
57
+        if (empty($requestValue) && (!empty($item->$fieldName))) {
58 58
             $requestValue = $item->$fieldName;
59 59
         }
60 60
 
Please login to merge, or discard this patch.