Test Setup Failed
Push — master ( 460730...7fbd38 )
by Manu
02:52
created
src/Http/Controllers/Brand_ModelController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $brand_models = Brand_model::paginate(5);
23 23
 
24
-        return view('manteniments/brand_model/index', ['brand_models' => $brand_models]);
24
+        return view('manteniments/brand_model/index', [ 'brand_models' => $brand_models ]);
25 25
     }
26 26
 
27 27
     /**
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $this->validateInput($request);
47 47
         Brand_model::create([
48
-         'name'        => $request['name'],
49
-         'description' => $request['description'],
48
+         'name'        => $request[ 'name' ],
49
+         'description' => $request[ 'description' ],
50 50
            ]);
51 51
 
52 52
         return redirect()->intended('mnt/brand_model');
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
           return redirect()->intended('/mnt/brand_model');
80 80
       }
81 81
 
82
-        return view('manteniments/brand_model/edit', ['brand_model' => $brand_model]);
82
+        return view('manteniments/brand_model/edit', [ 'brand_model' => $brand_model ]);
83 83
     }
84 84
 
85 85
     /**
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
     {
95 95
         $brand_model = Brand_model::findOrFail($id);
96 96
         $input = [
97
-        'name'        => $request['name'],
98
-        'description' => $request['description'],
97
+        'name'        => $request[ 'name' ],
98
+        'description' => $request[ 'description' ],
99 99
       ];
100 100
         $this->validate($request, [
101 101
       'name' => 'required|max:60',
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
     public function search(Request $request)
124 124
     {
125 125
         $constraints = [
126
-            'name' => $request['name'],
126
+            'name' => $request[ 'name' ],
127 127
             ];
128 128
         $brand_models = $this->doSearchingQuery($constraints);
129 129
 
130
-        return view('manteniments/brand_model/index', ['brand_models' => $brand_models, 'searchingVals' => $constraints]);
130
+        return view('manteniments/brand_model/index', [ 'brand_models' => $brand_models, 'searchingVals' => $constraints ]);
131 131
     }
132 132
 
133 133
     private function doSearchingQuery($constraints)
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $index = 0;
138 138
         foreach ($constraints as $constraint) {
139 139
             if ($constraint != null) {
140
-                $query = $query->where($fields[$index], 'like', '%'.$constraint.'%');
140
+                $query = $query->where($fields[ $index ], 'like', '%' . $constraint . '%');
141 141
             }
142 142
             $index++;
143 143
         }
Please login to merge, or discard this patch.
src/Http/Controllers/BrandController.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $brands = Brand::paginate(5);
23 23
 
24
-        return view('manteniments/brand/index', ['brands' => $brands]);
24
+        return view('manteniments/brand/index', [ 'brands' => $brands ]);
25 25
     }
26 26
 
27 27
     /**
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $this->validateInput($request);
47 47
         Brand::create([
48
-         'name'          => $request['name'],
49
-         'shortName'     => $request['shortName'],
50
-         'description'   => $request['description'],
51
-         'date_entrance' => $request['date_entrance'],
52
-         'last_update'   => $request['last_update'],
48
+         'name'          => $request[ 'name' ],
49
+         'shortName'     => $request[ 'shortName' ],
50
+         'description'   => $request[ 'description' ],
51
+         'date_entrance' => $request[ 'date_entrance' ],
52
+         'last_update'   => $request[ 'last_update' ],
53 53
            ]);
54 54
 
55 55
         return redirect()->intended('mnt/brand');
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
           return redirect()->intended('/mnt/brand');
83 83
       }
84 84
 
85
-        return view('manteniments/brand/edit', ['brand' => $brand]);
85
+        return view('manteniments/brand/edit', [ 'brand' => $brand ]);
86 86
     }
87 87
 
88 88
     /**
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
     {
98 98
         $brand = Brand::findOrFail($id);
99 99
         $input = [
100
-        'name'          => $request['name'],
101
-        'shortName'     => $request['shortName'],
102
-        'description'   => $request['description'],
103
-        'date_entrance' => $request['date_entrance'],
104
-        'last_update'   => $request['last_update'],
100
+        'name'          => $request[ 'name' ],
101
+        'shortName'     => $request[ 'shortName' ],
102
+        'description'   => $request[ 'description' ],
103
+        'date_entrance' => $request[ 'date_entrance' ],
104
+        'last_update'   => $request[ 'last_update' ],
105 105
       ];
106 106
         $this->validate($request, [
107 107
       'name' => 'required|max:60',
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
     public function search(Request $request)
130 130
     {
131 131
         $constraints = [
132
-            'name'      => $request['name'],
133
-            'shortName' => $request['shortName'],
132
+            'name'      => $request[ 'name' ],
133
+            'shortName' => $request[ 'shortName' ],
134 134
             ];
135 135
         $brands = $this->doSearchingQuery($constraints);
136 136
 
137
-        return view('manteniments/brand/index', ['brands' => $brands, 'searchingVals' => $constraints]);
137
+        return view('manteniments/brand/index', [ 'brands' => $brands, 'searchingVals' => $constraints ]);
138 138
     }
139 139
 
140 140
     private function doSearchingQuery($constraints)
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         $index = 0;
145 145
         foreach ($constraints as $constraint) {
146 146
             if ($constraint != null) {
147
-                $query = $query->where($fields[$index], 'like', '%'.$constraint.'%');
147
+                $query = $query->where($fields[ $index ], 'like', '%' . $constraint . '%');
148 148
             }
149 149
             $index++;
150 150
         }
Please login to merge, or discard this patch.
src/Http/Controllers/InventoryController.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         'provider.name as provider_name', 'provider.id as provider_id')
44 44
         ->paginate(5);
45 45
 
46
-        return view('inventory/index', ['inventories' => $inventories]);
46
+        return view('inventory/index', [ 'inventories' => $inventories ]);
47 47
     }
48 48
 
49 49
     /**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $locations = Location::all();
61 61
         $providers = Provider::all();
62 62
 
63
-        return view('inventory/create', ['material_types' => $material_types, 'brands' => $brands, 'brand_models' => $brand_models,
63
+        return view('inventory/create', [ 'material_types' => $material_types, 'brands' => $brands, 'brand_models' => $brand_models,
64 64
       'moneySources'                                      => $moneySources, 'locations' => $locations, 'providers' => $providers, ]);
65 65
     }
66 66
 
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
         $this->validateInput($request);
77 77
         // Upload image
78 78
         $path = $request->file('picture')->store('avatars');
79
-        $keys = ['name', 'description', 'material_type_id', 'brand_id', 'model_id', 'location_id', 'quantity', 'price',
79
+        $keys = [ 'name', 'description', 'material_type_id', 'brand_id', 'model_id', 'location_id', 'quantity', 'price',
80 80
         'moneysourceId', 'provider_id', 'date_entrance', 'last_update', ];
81 81
         $input = $this->createQueryInput($keys, $request);
82
-        $input['picture'] = $path;
82
+        $input[ 'picture' ] = $path;
83 83
 
84 84
         Inventory::create($input);
85 85
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $locations = Location::all();
121 121
         $providers = Provider::all();
122 122
 
123
-        return view('inventory/edit', ['inventory' => $inventory, 'material_types' => $material_types, 'brands' => $brands,  'brand_models' => $brand_models, 'moneySources' => $moneySources,
123
+        return view('inventory/edit', [ 'inventory' => $inventory, 'material_types' => $material_types, 'brands' => $brands, 'brand_models' => $brand_models, 'moneySources' => $moneySources,
124 124
         'locations'                                => $locations, 'providers' => $providers, ]);
125 125
     }
126 126
 
@@ -137,12 +137,12 @@  discard block
 block discarded – undo
137 137
         $inventory = Inventory::findOrFail($id);
138 138
         $this->validateInput($request);
139 139
         // Upload image
140
-        $keys = ['name', 'description', 'material_type_id', 'brand_id', 'model_id', 'location_id', 'quantity',
140
+        $keys = [ 'name', 'description', 'material_type_id', 'brand_id', 'model_id', 'location_id', 'quantity',
141 141
         'price', 'moneysourceId', 'provider_id', 'date_entrance', 'last_update', ];
142 142
         $input = $this->createQueryInput($keys, $request);
143 143
         if ($request->file('picture')) {
144 144
             $path = $request->file('picture')->store('public');
145
-            $input['picture'] = $path;
145
+            $input[ 'picture' ] = $path;
146 146
         }
147 147
         Inventory::where('id', $id)
148 148
             ->update($input);
@@ -174,11 +174,11 @@  discard block
 block discarded – undo
174 174
     public function search(Request $request)
175 175
     {
176 176
         $constraints = [
177
-            'name' => $request['name'],
177
+            'name' => $request[ 'name' ],
178 178
             ];
179 179
         $inventories = $this->doSearchingQuery($constraints);
180 180
 
181
-        return view('inventory/index', ['inventories' => $inventories, 'searchingVals' => $constraints]);
181
+        return view('inventory/index', [ 'inventories' => $inventories, 'searchingVals' => $constraints ]);
182 182
     }
183 183
 
184 184
     private function doSearchingQuery($constraints)
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         $index = 0;
189 189
         foreach ($constraints as $constraint) {
190 190
             if ($constraint != null) {
191
-                $query = $query->where($fields[$index], 'like', '%'.$constraint.'%');
191
+                $query = $query->where($fields[ $index ], 'like', '%' . $constraint . '%');
192 192
             }
193 193
             $index++;
194 194
         }
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
       */
206 206
      public function load($name)
207 207
      {
208
-         $path = storage_path().'/app/public/'.$name;
208
+         $path = storage_path() . '/app/public/' . $name;
209 209
          if (file_exists($path)) {
210 210
              return Response::download($path);
211 211
          }
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
 
221 221
     private function createQueryInput($keys, $request)
222 222
     {
223
-        $queryInput = [];
223
+        $queryInput = [ ];
224 224
         for ($i = 0; $i < count($keys); $i++) {
225
-            $key = $keys[$i];
226
-            $queryInput[$key] = $request[$key];
225
+            $key = $keys[ $i ];
226
+            $queryInput[ $key ] = $request[ $key ];
227 227
         }
228 228
 
229 229
         return $queryInput;
Please login to merge, or discard this patch.
src/Http/Controllers/ExportController.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         'provider.name as provider_name', 'provider.id as provider_id')
49 49
         ->paginate();
50 50
 
51
-        return view('/export/index', ['inventories' =>$inventories, 'searchingVals' => $constraints]);
51
+        return view('/export/index', [ 'inventories' =>$inventories, 'searchingVals' => $constraints ]);
52 52
 
53 53
         //$inventories = $this->getItemsInventory($constraints);
54 54
         //return view('/export/index', ['inventories' =>$inventories, 'searchingVals' => $constraints]);
@@ -70,26 +70,26 @@  discard block
 block discarded – undo
70 70
     public function exportPDF(Request $request)
71 71
     {
72 72
         $constraints = [
73
-           'from' => $request['from'],
74
-           'to'   => $request['to'],
73
+           'from' => $request[ 'from' ],
74
+           'to'   => $request[ 'to' ],
75 75
        ];
76 76
         $inventories = $this->getExportingData($constraints);
77
-        $pdf = PDF::loadView('export/exportpdf', ['inventories' => $inventories, 'searchingVals' => $constraints])->setPaper('a4', 'landscape');
77
+        $pdf = PDF::loadView('export/exportpdf', [ 'inventories' => $inventories, 'searchingVals' => $constraints ])->setPaper('a4', 'landscape');
78 78
 
79
-        return $pdf->download('Exportat_desde_'.$request['from'].'_a_'.$request['to'].'.pdf');
79
+        return $pdf->download('Exportat_desde_' . $request[ 'from' ] . '_a_' . $request[ 'to' ] . '.pdf');
80 80
     }
81 81
 
82 82
     private function prepareExportingData($request)
83 83
     {
84
-        $inventories = $this->getExportingData(['from'=> $request['from'], 'to' => $request['to']]);
84
+        $inventories = $this->getExportingData([ 'from'=> $request[ 'from' ], 'to' => $request[ 'to' ] ]);
85 85
 
86
-        return Excel::create('Exportat_desde_'.$request['from'].'_a_'.$request['to'], function ($excel) use ($inventories, $request) {
86
+        return Excel::create('Exportat_desde_' . $request[ 'from' ] . '_a_' . $request[ 'to' ], function($excel) use ($inventories, $request) {
87 87
             // Set the title
88
-       $excel->setTitle('Inventari from '.$request['from'].' to '.$request['to']);
88
+       $excel->setTitle('Inventari from ' . $request[ 'from' ] . ' to ' . $request[ 'to' ]);
89 89
 
90 90
        // Call them separately
91 91
        $excel->setDescription('Llista');
92
-            $excel->sheet('Items', function ($sheet) use ($inventories) {
92
+            $excel->sheet('Items', function($sheet) use ($inventories) {
93 93
                 $sheet->fromArray($inventories);
94 94
             });
95 95
         });
@@ -98,18 +98,18 @@  discard block
 block discarded – undo
98 98
     public function search(Request $request)
99 99
     {
100 100
         $constraints = [
101
-           'from' => $request['from'],
102
-           'to'   => $request['to'],
101
+           'from' => $request[ 'from' ],
102
+           'to'   => $request[ 'to' ],
103 103
        ];
104 104
         $inventories = $this->getItemsInventory($constraints);
105 105
 
106
-        return view('export/index', ['inventories' => $inventories, 'searchingVals' => $constraints]);
106
+        return view('export/index', [ 'inventories' => $inventories, 'searchingVals' => $constraints ]);
107 107
     }
108 108
 
109 109
     private function getItemsInventory($constraints)
110 110
     {
111
-        $inventories = Inventory::where('date_entrance', '>=', $constraints['from'])
112
-                       ->where('date_entrance', '<=', $constraints['to'])
111
+        $inventories = Inventory::where('date_entrance', '>=', $constraints[ 'from' ])
112
+                       ->where('date_entrance', '<=', $constraints[ 'to' ])
113 113
                        ->get();
114 114
 
115 115
         return $inventories;
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
        'location.name as location_name', 'moneySource.name as moneySource_name', 'provider.name as provider_name', 'inventories.quantity as quantity', 'inventories.price as price', 'inventories.date_entrance as date_entrance', 'inventories.last_update as last_update')
129 129
 
130 130
        ->get()
131
-       ->map(function ($item, $key) {
131
+       ->map(function($item, $key) {
132 132
            return (array) $item;
133 133
        })
134 134
        ->all();
Please login to merge, or discard this patch.
src/Http/Controllers/ProviderController.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $providers = Provider::paginate(5);
23 23
 
24
-        return view('manteniments/providers/index', ['providers' => $providers]);
24
+        return view('manteniments/providers/index', [ 'providers' => $providers ]);
25 25
     }
26 26
 
27 27
     /**
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $this->validateInput($request);
47 47
         Provider::create([
48
-         'name'          => $request['name'],
49
-         'shortName'     => $request['shortName'],
50
-         'description'   => $request['description'],
51
-         'date_entrance' => $request['date_entrance'],
52
-         'last_update'   => $request['last_update'],
48
+         'name'          => $request[ 'name' ],
49
+         'shortName'     => $request[ 'shortName' ],
50
+         'description'   => $request[ 'description' ],
51
+         'date_entrance' => $request[ 'date_entrance' ],
52
+         'last_update'   => $request[ 'last_update' ],
53 53
            ]);
54 54
 
55 55
         return redirect()->intended('mnt/provider');
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
           return redirect()->intended('/mnt/provider');
83 83
       }
84 84
 
85
-        return view('manteniments/providers/edit', ['provider' => $provider]);
85
+        return view('manteniments/providers/edit', [ 'provider' => $provider ]);
86 86
     }
87 87
 
88 88
     /**
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
     {
98 98
         $provider = Provider::findOrFail($id);
99 99
         $input = [
100
-        'name'          => $request['name'],
101
-        'shortName'     => $request['shortName'],
102
-        'description'   => $request['description'],
103
-        'date_entrance' => $request['date_entrance'],
104
-        'last_update'   => $request['last_update'],
100
+        'name'          => $request[ 'name' ],
101
+        'shortName'     => $request[ 'shortName' ],
102
+        'description'   => $request[ 'description' ],
103
+        'date_entrance' => $request[ 'date_entrance' ],
104
+        'last_update'   => $request[ 'last_update' ],
105 105
       ];
106 106
         $this->validate($request, [
107 107
       'name' => 'required|max:60',
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
     public function search(Request $request)
130 130
     {
131 131
         $constraints = [
132
-            'name'      => $request['name'],
133
-            'shortName' => $request['shortName'],
132
+            'name'      => $request[ 'name' ],
133
+            'shortName' => $request[ 'shortName' ],
134 134
             ];
135 135
         $providers = $this->doSearchingQuery($constraints);
136 136
 
137
-        return view('manteniments/providers/index', ['providers' => $providers, 'searchingVals' => $constraints]);
137
+        return view('manteniments/providers/index', [ 'providers' => $providers, 'searchingVals' => $constraints ]);
138 138
     }
139 139
 
140 140
     private function doSearchingQuery($constraints)
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         $index = 0;
145 145
         foreach ($constraints as $constraint) {
146 146
             if ($constraint != null) {
147
-                $query = $query->where($fields[$index], 'like', '%'.$constraint.'%');
147
+                $query = $query->where($fields[ $index ], 'like', '%' . $constraint . '%');
148 148
             }
149 149
             $index++;
150 150
         }
Please login to merge, or discard this patch.
src/Http/Controllers/Material_TypeController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $material_types = Material_type::paginate(5);
23 23
 
24
-        return view('manteniments/material_type/index', ['material_types' => $material_types]);
24
+        return view('manteniments/material_type/index', [ 'material_types' => $material_types ]);
25 25
     }
26 26
 
27 27
     /**
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $this->validateInput($request);
47 47
         Material_type::create([
48
-         'name'        => $request['name'],
49
-         'description' => $request['description'],
48
+         'name'        => $request[ 'name' ],
49
+         'description' => $request[ 'description' ],
50 50
            ]);
51 51
 
52 52
         return redirect()->intended('mnt/material_type');
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
           return redirect()->intended('/mnt/material_type');
80 80
       }
81 81
 
82
-        return view('manteniments/material_type/edit', ['material_type' => $material_type]);
82
+        return view('manteniments/material_type/edit', [ 'material_type' => $material_type ]);
83 83
     }
84 84
 
85 85
     /**
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
     {
95 95
         $material_type = Material_type::findOrFail($id);
96 96
         $input = [
97
-        'name'        => $request['name'],
98
-        'description' => $request['description'],
97
+        'name'        => $request[ 'name' ],
98
+        'description' => $request[ 'description' ],
99 99
       ];
100 100
         $this->validate($request, [
101 101
       'name' => 'required|max:60',
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
     public function search(Request $request)
124 124
     {
125 125
         $constraints = [
126
-            'name' => $request['name'],
126
+            'name' => $request[ 'name' ],
127 127
             ];
128 128
         $material_types = $this->doSearchingQuery($constraints);
129 129
 
130
-        return view('manteniments/material_type/index', ['material_types' => $material_types, 'searchingVals' => $constraints]);
130
+        return view('manteniments/material_type/index', [ 'material_types' => $material_types, 'searchingVals' => $constraints ]);
131 131
     }
132 132
 
133 133
     private function doSearchingQuery($constraints)
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $index = 0;
138 138
         foreach ($constraints as $constraint) {
139 139
             if ($constraint != null) {
140
-                $query = $query->where($fields[$index], 'like', '%'.$constraint.'%');
140
+                $query = $query->where($fields[ $index ], 'like', '%' . $constraint . '%');
141 141
             }
142 142
             $index++;
143 143
         }
Please login to merge, or discard this patch.
src/Http/Controllers/MoneySourceController.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $moneySources = MoneySource::paginate(5);
23 23
 
24
-        return view('manteniments/moneySource/index', ['moneySources' => $moneySources]);
24
+        return view('manteniments/moneySource/index', [ 'moneySources' => $moneySources ]);
25 25
     }
26 26
 
27 27
     /**
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $this->validateInput($request);
47 47
         MoneySource::create([
48
-         'name'          => $request['name'],
49
-         'shortName'     => $request['shortName'],
50
-         'description'   => $request['description'],
51
-         'date_entrance' => $request['date_entrance'],
52
-         'last_update'   => $request['last_update'],
48
+         'name'          => $request[ 'name' ],
49
+         'shortName'     => $request[ 'shortName' ],
50
+         'description'   => $request[ 'description' ],
51
+         'date_entrance' => $request[ 'date_entrance' ],
52
+         'last_update'   => $request[ 'last_update' ],
53 53
            ]);
54 54
 
55 55
         return redirect()->intended('mnt/moneySource');
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
           return redirect()->intended('/mnt/moneySource');
83 83
       }
84 84
 
85
-        return view('manteniments/moneySource/edit', ['moneySource' => $moneySource]);
85
+        return view('manteniments/moneySource/edit', [ 'moneySource' => $moneySource ]);
86 86
     }
87 87
 
88 88
     /**
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
     {
98 98
         $moneySource = MoneySource::findOrFail($id);
99 99
         $input = [
100
-        'name'          => $request['name'],
101
-        'shortName'     => $request['shortName'],
102
-        'description'   => $request['description'],
103
-        'date_entrance' => $request['date_entrance'],
104
-        'last_update'   => $request['last_update'],
100
+        'name'          => $request[ 'name' ],
101
+        'shortName'     => $request[ 'shortName' ],
102
+        'description'   => $request[ 'description' ],
103
+        'date_entrance' => $request[ 'date_entrance' ],
104
+        'last_update'   => $request[ 'last_update' ],
105 105
       ];
106 106
         $this->validate($request, [
107 107
       'name' => 'required|max:60',
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
     public function search(Request $request)
130 130
     {
131 131
         $constraints = [
132
-            'name'      => $request['name'],
133
-            'shortName' => $request['shortName'],
132
+            'name'      => $request[ 'name' ],
133
+            'shortName' => $request[ 'shortName' ],
134 134
             ];
135 135
         $moneySources = $this->doSearchingQuery($constraints);
136 136
 
137
-        return view('manteniments/moneySource/index', ['moneySources' => $moneySources, 'searchingVals' => $constraints]);
137
+        return view('manteniments/moneySource/index', [ 'moneySources' => $moneySources, 'searchingVals' => $constraints ]);
138 138
     }
139 139
 
140 140
     private function doSearchingQuery($constraints)
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         $index = 0;
145 145
         foreach ($constraints as $constraint) {
146 146
             if ($constraint != null) {
147
-                $query = $query->where($fields[$index], 'like', '%'.$constraint.'%');
147
+                $query = $query->where($fields[ $index ], 'like', '%' . $constraint . '%');
148 148
             }
149 149
             $index++;
150 150
         }
Please login to merge, or discard this patch.
src/Http/Controllers/LocationController.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     {
22 22
         $locations = Location::paginate(5);
23 23
 
24
-        return view('manteniments/location/index', ['locations' => $locations]);
24
+        return view('manteniments/location/index', [ 'locations' => $locations ]);
25 25
     }
26 26
 
27 27
     /**
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $this->validateInput($request);
47 47
         Location::create([
48
-         'name'          => $request['name'],
49
-         'shortName'     => $request['shortName'],
50
-         'description'   => $request['description'],
51
-         'date_entrance' => $request['date_entrance'],
52
-         'last_update'   => $request['last_update'],
48
+         'name'          => $request[ 'name' ],
49
+         'shortName'     => $request[ 'shortName' ],
50
+         'description'   => $request[ 'description' ],
51
+         'date_entrance' => $request[ 'date_entrance' ],
52
+         'last_update'   => $request[ 'last_update' ],
53 53
            ]);
54 54
 
55 55
         return redirect()->intended('mnt/location');
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
           return redirect()->intended('/mnt/location');
83 83
       }
84 84
 
85
-        return view('manteniments/location/edit', ['location' => $location]);
85
+        return view('manteniments/location/edit', [ 'location' => $location ]);
86 86
     }
87 87
 
88 88
     /**
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
     {
98 98
         $location = Location::findOrFail($id);
99 99
         $input = [
100
-        'name'          => $request['name'],
101
-        'shortName'     => $request['shortName'],
102
-        'description'   => $request['description'],
103
-        'date_entrance' => $request['date_entrance'],
104
-        'last_update'   => $request['last_update'],
100
+        'name'          => $request[ 'name' ],
101
+        'shortName'     => $request[ 'shortName' ],
102
+        'description'   => $request[ 'description' ],
103
+        'date_entrance' => $request[ 'date_entrance' ],
104
+        'last_update'   => $request[ 'last_update' ],
105 105
       ];
106 106
         $this->validate($request, [
107 107
       'name' => 'required|max:60',
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
     public function search(Request $request)
130 130
     {
131 131
         $constraints = [
132
-            'name'      => $request['name'],
133
-            'shortName' => $request['shortName'],
132
+            'name'      => $request[ 'name' ],
133
+            'shortName' => $request[ 'shortName' ],
134 134
             ];
135 135
         $locations = $this->doSearchingQuery($constraints);
136 136
 
137
-        return view('manteniments/location/index', ['locations' => $locations, 'searchingVals' => $constraints]);
137
+        return view('manteniments/location/index', [ 'locations' => $locations, 'searchingVals' => $constraints ]);
138 138
     }
139 139
 
140 140
     private function doSearchingQuery($constraints)
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         $index = 0;
145 145
         foreach ($constraints as $constraint) {
146 146
             if ($constraint != null) {
147
-                $query = $query->where($fields[$index], 'like', '%'.$constraint.'%');
147
+                $query = $query->where($fields[ $index ], 'like', '%' . $constraint . '%');
148 148
             }
149 149
             $index++;
150 150
         }
Please login to merge, or discard this patch.