@@ -218,6 +218,9 @@ |
||
| 218 | 218 | ]); |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | + /** |
|
| 222 | + * @param string[] $keys |
|
| 223 | + */ |
|
| 221 | 224 | private function createQueryInput($keys, $request) |
| 222 | 225 | { |
| 223 | 226 | $queryInput = []; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $providers = Provider::all(); |
| 62 | 62 | |
| 63 | 63 | return view('inventory/create', ['material_types' => $material_types, 'brands' => $brands, 'brand_models' => $brand_models, |
| 64 | - 'moneySources' => $moneySources, 'locations' => $locations, 'providers' => $providers, ]); |
|
| 64 | + 'moneySources' => $moneySources, 'locations' => $locations, 'providers' => $providers, ]); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -196,20 +196,20 @@ discard block |
||
| 196 | 196 | return $query->paginate(5); |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - /** |
|
| 200 | - * Load image resource. |
|
| 201 | - * |
|
| 202 | - * @param string $name |
|
| 203 | - * |
|
| 204 | - * @return \Illuminate\Http\Response |
|
| 205 | - */ |
|
| 206 | - public function load($name) |
|
| 207 | - { |
|
| 208 | - $path = storage_path().'/app/public/'.$name; |
|
| 209 | - if (file_exists($path)) { |
|
| 210 | - return Response::download($path); |
|
| 211 | - } |
|
| 212 | - } |
|
| 199 | + /** |
|
| 200 | + * Load image resource. |
|
| 201 | + * |
|
| 202 | + * @param string $name |
|
| 203 | + * |
|
| 204 | + * @return \Illuminate\Http\Response |
|
| 205 | + */ |
|
| 206 | + public function load($name) |
|
| 207 | + { |
|
| 208 | + $path = storage_path().'/app/public/'.$name; |
|
| 209 | + if (file_exists($path)) { |
|
| 210 | + return Response::download($path); |
|
| 211 | + } |
|
| 212 | + } |
|
| 213 | 213 | |
| 214 | 214 | private function validateInput($request) |
| 215 | 215 | { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | 'moneySource.name as moneySource_name', 'moneySource.id as moneySourceId', 'provider.name as provider_name', 'provider.id as provider_id') |
| 45 | 45 | ->paginate(5); |
| 46 | 46 | |
| 47 | - return view('inventory/index', ['inventories' => $inventories]); |
|
| 47 | + return view('inventory/index', [ 'inventories' => $inventories ]); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $locations = Location::all(); |
| 62 | 62 | $providers = Provider::all(); |
| 63 | 63 | |
| 64 | - return view('inventory/create', ['material_types' => $material_types, 'brands' => $brands, 'brand_models' => $brand_models, |
|
| 64 | + return view('inventory/create', [ 'material_types' => $material_types, 'brands' => $brands, 'brand_models' => $brand_models, |
|
| 65 | 65 | 'moneySources' => $moneySources, 'locations' => $locations, 'providers' => $providers, ]); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -77,10 +77,10 @@ discard block |
||
| 77 | 77 | $this->validateInput($request); |
| 78 | 78 | // Upload image |
| 79 | 79 | $path = $request->file('picture')->store('avatars'); |
| 80 | - $keys = ['name', 'description', 'material_type_id', 'brand_id', 'model_id', 'location_id', 'quantity', 'price', |
|
| 80 | + $keys = [ 'name', 'description', 'material_type_id', 'brand_id', 'model_id', 'location_id', 'quantity', 'price', |
|
| 81 | 81 | 'moneysourceId', 'provider_id', 'date_entrance', 'last_update', ]; |
| 82 | 82 | $input = $this->createQueryInput($keys, $request); |
| 83 | - $input['picture'] = $path; |
|
| 83 | + $input[ 'picture' ] = $path; |
|
| 84 | 84 | |
| 85 | 85 | Inventory::create($input); |
| 86 | 86 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $locations = Location::all(); |
| 122 | 122 | $providers = Provider::all(); |
| 123 | 123 | |
| 124 | - return view('inventory/edit', ['inventory' => $inventory, 'material_types' => $material_types, 'brands' => $brands, 'brand_models' => $brand_models, |
|
| 124 | + return view('inventory/edit', [ 'inventory' => $inventory, 'material_types' => $material_types, 'brands' => $brands, 'brand_models' => $brand_models, |
|
| 125 | 125 | 'moneySources' => $moneySources, 'locations'=> $locations, 'providers' => $providers, ]); |
| 126 | 126 | } |
| 127 | 127 | |
@@ -138,12 +138,12 @@ discard block |
||
| 138 | 138 | $inventory = Inventory::findOrFail($id); |
| 139 | 139 | $this->validateInput($request); |
| 140 | 140 | // Upload image |
| 141 | - $keys = ['name', 'description', 'material_type_id', 'brand_id', 'model_id', 'location_id', 'quantity', |
|
| 141 | + $keys = [ 'name', 'description', 'material_type_id', 'brand_id', 'model_id', 'location_id', 'quantity', |
|
| 142 | 142 | 'price', 'moneysourceId', 'provider_id', 'date_entrance', 'last_update', ]; |
| 143 | 143 | $input = $this->createQueryInput($keys, $request); |
| 144 | 144 | if ($request->file('picture')) { |
| 145 | 145 | $path = $request->file('picture')->store('public'); |
| 146 | - $input['picture'] = $path; |
|
| 146 | + $input[ 'picture' ] = $path; |
|
| 147 | 147 | } |
| 148 | 148 | Inventory::where('id', $id) |
| 149 | 149 | ->update($input); |
@@ -175,11 +175,11 @@ discard block |
||
| 175 | 175 | public function search(Request $request) |
| 176 | 176 | { |
| 177 | 177 | $constraints = [ |
| 178 | - 'name' => $request['name'], |
|
| 178 | + 'name' => $request[ 'name' ], |
|
| 179 | 179 | ]; |
| 180 | 180 | $inventories = $this->doSearchingQuery($constraints); |
| 181 | 181 | |
| 182 | - return view('inventory/index', ['inventories' => $inventories, 'searchingVals' => $constraints]); |
|
| 182 | + return view('inventory/index', [ 'inventories' => $inventories, 'searchingVals' => $constraints ]); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | private function doSearchingQuery($constraints) |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $index = 0; |
| 190 | 190 | foreach ($constraints as $constraint) { |
| 191 | 191 | if ($constraint != null) { |
| 192 | - $query = $query->where($fields[$index], 'like', '%'.$constraint.'%'); |
|
| 192 | + $query = $query->where($fields[ $index ], 'like', '%' . $constraint . '%'); |
|
| 193 | 193 | } |
| 194 | 194 | $index++; |
| 195 | 195 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | public function load($name) |
| 208 | 208 | { |
| 209 | - $path = storage_path().'/app/public/'.$name; |
|
| 209 | + $path = storage_path() . '/app/public/' . $name; |
|
| 210 | 210 | if (file_exists($path)) { |
| 211 | 211 | return Response::download($path); |
| 212 | 212 | } |
@@ -233,10 +233,10 @@ discard block |
||
| 233 | 233 | |
| 234 | 234 | private function createQueryInput($keys, $request) |
| 235 | 235 | { |
| 236 | - $queryInput = []; |
|
| 236 | + $queryInput = [ ]; |
|
| 237 | 237 | for ($i = 0; $i < count($keys); $i++) { |
| 238 | - $key = $keys[$i]; |
|
| 239 | - $queryInput[$key] = $request[$key]; |
|
| 238 | + $key = $keys[ $i ]; |
|
| 239 | + $queryInput[ $key ] = $request[ $key ]; |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | return $queryInput; |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Http\Controllers; |
| 4 | 4 | |
| 5 | -use App\Material_Type; |
|
| 6 | 5 | use Illuminate\Http\Request; |
| 7 | 6 | |
| 8 | 7 | class Material_TypeController extends Controller |
@@ -8,14 +8,14 @@ discard block |
||
| 8 | 8 | class Material_TypeController extends Controller |
| 9 | 9 | { |
| 10 | 10 | /** |
| 11 | - * Display a listing of the resource. |
|
| 12 | - * |
|
| 13 | - * @return \Illuminate\Http\Response |
|
| 14 | - */ |
|
| 15 | - public function __construct() |
|
| 16 | - { |
|
| 17 | - $this->middleware('auth'); |
|
| 18 | - } |
|
| 11 | + * Display a listing of the resource. |
|
| 12 | + * |
|
| 13 | + * @return \Illuminate\Http\Response |
|
| 14 | + */ |
|
| 15 | + public function __construct() |
|
| 16 | + { |
|
| 17 | + $this->middleware('auth'); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | 20 | public function index() |
| 21 | 21 | { |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | $this->validateInput($request); |
| 47 | 47 | Material_type::create([ |
| 48 | - 'name' => $request['name'], |
|
| 49 | - 'description' => $request['description'], |
|
| 50 | - ]); |
|
| 48 | + 'name' => $request['name'], |
|
| 49 | + 'description' => $request['description'], |
|
| 50 | + ]); |
|
| 51 | 51 | |
| 52 | 52 | return redirect()->intended('mnt/material_type'); |
| 53 | 53 | } |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | public function edit($id) |
| 75 | 75 | { |
| 76 | 76 | $material_type = Material_type::find($id); |
| 77 | - // Redirect to country list if updating country wasn't existed |
|
| 78 | - if ($material_type == null || count($material_type) == 0) { |
|
| 79 | - return redirect()->intended('/mnt/material_type'); |
|
| 80 | - } |
|
| 77 | + // Redirect to country list if updating country wasn't existed |
|
| 78 | + if ($material_type == null || count($material_type) == 0) { |
|
| 79 | + return redirect()->intended('/mnt/material_type'); |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | 82 | return view('manteniments/material_type/edit', ['material_type' => $material_type]); |
| 83 | 83 | } |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | $input = [ |
| 97 | 97 | 'name' => $request['name'], |
| 98 | 98 | 'description' => $request['description'], |
| 99 | - ]; |
|
| 99 | + ]; |
|
| 100 | 100 | $this->validate($request, [ |
| 101 | - 'name' => 'required|max:60', |
|
| 102 | - ]); |
|
| 101 | + 'name' => 'required|max:60', |
|
| 102 | + ]); |
|
| 103 | 103 | Material_type::where('id', $id) |
| 104 | - ->update($input); |
|
| 104 | + ->update($input); |
|
| 105 | 105 | |
| 106 | 106 | return redirect()->intended('mnt/material_type'); |
| 107 | 107 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -8,14 +8,14 @@ discard block |
||
| 8 | 8 | class LocationController extends Controller |
| 9 | 9 | { |
| 10 | 10 | /** |
| 11 | - * Display a listing of the resource. |
|
| 12 | - * |
|
| 13 | - * @return \Illuminate\Http\Response |
|
| 14 | - */ |
|
| 15 | - public function __construct() |
|
| 16 | - { |
|
| 17 | - $this->middleware('auth'); |
|
| 18 | - } |
|
| 11 | + * Display a listing of the resource. |
|
| 12 | + * |
|
| 13 | + * @return \Illuminate\Http\Response |
|
| 14 | + */ |
|
| 15 | + public function __construct() |
|
| 16 | + { |
|
| 17 | + $this->middleware('auth'); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | 20 | public function index() |
| 21 | 21 | { |
@@ -45,12 +45,12 @@ discard block |
||
| 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'], |
|
| 53 | - ]); |
|
| 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 | + ]); |
|
| 54 | 54 | |
| 55 | 55 | return redirect()->intended('mnt/location'); |
| 56 | 56 | } |
@@ -77,10 +77,10 @@ discard block |
||
| 77 | 77 | public function edit($id) |
| 78 | 78 | { |
| 79 | 79 | $location = Location::find($id); |
| 80 | - // Redirect to country list if updating country wasn't existed |
|
| 81 | - if ($location == null || count($location) == 0) { |
|
| 82 | - return redirect()->intended('/mnt/location'); |
|
| 83 | - } |
|
| 80 | + // Redirect to country list if updating country wasn't existed |
|
| 81 | + if ($location == null || count($location) == 0) { |
|
| 82 | + return redirect()->intended('/mnt/location'); |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | 85 | return view('manteniments/location/edit', ['location' => $location]); |
| 86 | 86 | } |
@@ -102,12 +102,12 @@ discard block |
||
| 102 | 102 | 'description' => $request['description'], |
| 103 | 103 | 'date_entrance' => $request['date_entrance'], |
| 104 | 104 | 'last_update' => $request['last_update'], |
| 105 | - ]; |
|
| 105 | + ]; |
|
| 106 | 106 | $this->validate($request, [ |
| 107 | - 'name' => 'required|max:60', |
|
| 108 | - ]); |
|
| 107 | + 'name' => 'required|max:60', |
|
| 108 | + ]); |
|
| 109 | 109 | Location::where('id', $id) |
| 110 | - ->update($input); |
|
| 110 | + ->update($input); |
|
| 111 | 111 | |
| 112 | 112 | return redirect()->intended('mnt/location'); |
| 113 | 113 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -8,14 +8,14 @@ discard block |
||
| 8 | 8 | class ProviderController extends Controller |
| 9 | 9 | { |
| 10 | 10 | /** |
| 11 | - * Display a listing of the resource. |
|
| 12 | - * |
|
| 13 | - * @return \Illuminate\Http\Response |
|
| 14 | - */ |
|
| 15 | - public function __construct() |
|
| 16 | - { |
|
| 17 | - $this->middleware('auth'); |
|
| 18 | - } |
|
| 11 | + * Display a listing of the resource. |
|
| 12 | + * |
|
| 13 | + * @return \Illuminate\Http\Response |
|
| 14 | + */ |
|
| 15 | + public function __construct() |
|
| 16 | + { |
|
| 17 | + $this->middleware('auth'); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | 20 | public function index() |
| 21 | 21 | { |
@@ -45,12 +45,12 @@ discard block |
||
| 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'], |
|
| 53 | - ]); |
|
| 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 | + ]); |
|
| 54 | 54 | |
| 55 | 55 | return redirect()->intended('mnt/provider'); |
| 56 | 56 | } |
@@ -77,10 +77,10 @@ discard block |
||
| 77 | 77 | public function edit($id) |
| 78 | 78 | { |
| 79 | 79 | $provider = Provider::find($id); |
| 80 | - // Redirect to country list if updating country wasn't existed |
|
| 81 | - if ($provider == null || count($provider) == 0) { |
|
| 82 | - return redirect()->intended('/mnt/provider'); |
|
| 83 | - } |
|
| 80 | + // Redirect to country list if updating country wasn't existed |
|
| 81 | + if ($provider == null || count($provider) == 0) { |
|
| 82 | + return redirect()->intended('/mnt/provider'); |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | 85 | return view('manteniments/providers/edit', ['provider' => $provider]); |
| 86 | 86 | } |
@@ -102,12 +102,12 @@ discard block |
||
| 102 | 102 | 'description' => $request['description'], |
| 103 | 103 | 'date_entrance' => $request['date_entrance'], |
| 104 | 104 | 'last_update' => $request['last_update'], |
| 105 | - ]; |
|
| 105 | + ]; |
|
| 106 | 106 | $this->validate($request, [ |
| 107 | - 'name' => 'required|max:60', |
|
| 108 | - ]); |
|
| 107 | + 'name' => 'required|max:60', |
|
| 108 | + ]); |
|
| 109 | 109 | Provider::where('id', $id) |
| 110 | - ->update($input); |
|
| 110 | + ->update($input); |
|
| 111 | 111 | |
| 112 | 112 | return redirect()->intended('mnt/provider'); |
| 113 | 113 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -8,14 +8,14 @@ discard block |
||
| 8 | 8 | class BrandController extends Controller |
| 9 | 9 | { |
| 10 | 10 | /** |
| 11 | - * Display a listing of the resource. |
|
| 12 | - * |
|
| 13 | - * @return \Illuminate\Http\Response |
|
| 14 | - */ |
|
| 15 | - public function __construct() |
|
| 16 | - { |
|
| 17 | - $this->middleware('auth'); |
|
| 18 | - } |
|
| 11 | + * Display a listing of the resource. |
|
| 12 | + * |
|
| 13 | + * @return \Illuminate\Http\Response |
|
| 14 | + */ |
|
| 15 | + public function __construct() |
|
| 16 | + { |
|
| 17 | + $this->middleware('auth'); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | 20 | public function index() |
| 21 | 21 | { |
@@ -45,12 +45,12 @@ discard block |
||
| 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'], |
|
| 53 | - ]); |
|
| 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 | + ]); |
|
| 54 | 54 | |
| 55 | 55 | return redirect()->intended('mnt/brand'); |
| 56 | 56 | } |
@@ -77,10 +77,10 @@ discard block |
||
| 77 | 77 | public function edit($id) |
| 78 | 78 | { |
| 79 | 79 | $brand = Brand::find($id); |
| 80 | - // Redirect to country list if updating country wasn't existed |
|
| 81 | - if ($brand == null || count($brand) == 0) { |
|
| 82 | - return redirect()->intended('/mnt/brand'); |
|
| 83 | - } |
|
| 80 | + // Redirect to country list if updating country wasn't existed |
|
| 81 | + if ($brand == null || count($brand) == 0) { |
|
| 82 | + return redirect()->intended('/mnt/brand'); |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | 85 | return view('manteniments/brand/edit', ['brand' => $brand]); |
| 86 | 86 | } |
@@ -102,12 +102,12 @@ discard block |
||
| 102 | 102 | 'description' => $request['description'], |
| 103 | 103 | 'date_entrance' => $request['date_entrance'], |
| 104 | 104 | 'last_update' => $request['last_update'], |
| 105 | - ]; |
|
| 105 | + ]; |
|
| 106 | 106 | $this->validate($request, [ |
| 107 | - 'name' => 'required|max:60', |
|
| 108 | - ]); |
|
| 107 | + 'name' => 'required|max:60', |
|
| 108 | + ]); |
|
| 109 | 109 | Brand::where('id', $id) |
| 110 | - ->update($input); |
|
| 110 | + ->update($input); |
|
| 111 | 111 | |
| 112 | 112 | return redirect()->intended('mnt/brand'); |
| 113 | 113 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | 'description' => $request['description'], |
| 78 | 78 | 'date_entrance' => $request['date_entrance'], |
| 79 | 79 | 'last_update' => $request['last_update'], |
| 80 | - ]); |
|
| 80 | + ]); |
|
| 81 | 81 | |
| 82 | 82 | return redirect()->intended('manteniments/providers'); |
| 83 | 83 | } |
@@ -92,10 +92,10 @@ discard block |
||
| 92 | 92 | public function edit($id) |
| 93 | 93 | { |
| 94 | 94 | $providers = Providers::find($id); |
| 95 | - // Redirect to country list if updating country wasn't existed |
|
| 96 | - if ($providers == null || count($providers) == 0) { |
|
| 97 | - return redirect()->intended('/manteniments/providers'); |
|
| 98 | - } |
|
| 95 | + // Redirect to country list if updating country wasn't existed |
|
| 96 | + if ($providers == null || count($providers) == 0) { |
|
| 97 | + return redirect()->intended('/manteniments/providers'); |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | 100 | return view('manteniments/providers/edit', ['providers' => $providers]); |
| 101 | 101 | } |
@@ -117,12 +117,12 @@ discard block |
||
| 117 | 117 | 'description' => $request['description'], |
| 118 | 118 | 'date_entrance' => $request['date_entrance'], |
| 119 | 119 | 'last_update' => $request['last_update'], |
| 120 | - ]; |
|
| 120 | + ]; |
|
| 121 | 121 | $this->validate($request, [ |
| 122 | - 'name' => 'required|max:60', |
|
| 123 | - ]); |
|
| 122 | + 'name' => 'required|max:60', |
|
| 123 | + ]); |
|
| 124 | 124 | Providers::where('id', $id) |
| 125 | - ->update($input); |
|
| 125 | + ->update($input); |
|
| 126 | 126 | |
| 127 | 127 | return redirect()->intended('manteniments/providers'); |
| 128 | 128 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $providers = Country::paginate(5); |
| 46 | 46 | |
| 47 | - return view('manteniments/providers/index', ['providers' => $providers]); |
|
| 47 | + return view('manteniments/providers/index', [ 'providers' => $providers ]); |
|
| 48 | 48 | |
| 49 | 49 | //return view('providers.index', compact('providers')); |
| 50 | 50 | } |
@@ -72,11 +72,11 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | $this->validateInput($request); |
| 74 | 74 | Country::create([ |
| 75 | - 'name' => $request['name'], |
|
| 76 | - 'shortName' => $request['shortName'], |
|
| 77 | - 'description' => $request['description'], |
|
| 78 | - 'date_entrance' => $request['date_entrance'], |
|
| 79 | - 'last_update' => $request['last_update'], |
|
| 75 | + 'name' => $request[ 'name' ], |
|
| 76 | + 'shortName' => $request[ 'shortName' ], |
|
| 77 | + 'description' => $request[ 'description' ], |
|
| 78 | + 'date_entrance' => $request[ 'date_entrance' ], |
|
| 79 | + 'last_update' => $request[ 'last_update' ], |
|
| 80 | 80 | ]); |
| 81 | 81 | |
| 82 | 82 | return redirect()->intended('manteniments/providers'); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | return redirect()->intended('/manteniments/providers'); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - return view('manteniments/providers/edit', ['providers' => $providers]); |
|
| 100 | + return view('manteniments/providers/edit', [ 'providers' => $providers ]); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -112,11 +112,11 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | $providers = Providers::findOrFail($id); |
| 114 | 114 | $input = [ |
| 115 | - 'name' => $request['name'], |
|
| 116 | - 'shortName' => $request['shortName'], |
|
| 117 | - 'description' => $request['description'], |
|
| 118 | - 'date_entrance' => $request['date_entrance'], |
|
| 119 | - 'last_update' => $request['last_update'], |
|
| 115 | + 'name' => $request[ 'name' ], |
|
| 116 | + 'shortName' => $request[ 'shortName' ], |
|
| 117 | + 'description' => $request[ 'description' ], |
|
| 118 | + 'date_entrance' => $request[ 'date_entrance' ], |
|
| 119 | + 'last_update' => $request[ 'last_update' ], |
|
| 120 | 120 | ]; |
| 121 | 121 | $this->validate($request, [ |
| 122 | 122 | 'name' => 'required|max:60', |
@@ -144,12 +144,12 @@ discard block |
||
| 144 | 144 | public function search(Request $request) |
| 145 | 145 | { |
| 146 | 146 | $constraints = [ |
| 147 | - 'name' => $request['name'], |
|
| 148 | - 'shortName' => $request['shortName'], |
|
| 147 | + 'name' => $request[ 'name' ], |
|
| 148 | + 'shortName' => $request[ 'shortName' ], |
|
| 149 | 149 | ]; |
| 150 | 150 | $providers = $this->doSearchingQuery($constraints); |
| 151 | 151 | |
| 152 | - return view('manteniments/providers/index', ['providers' => $providers, 'searchingVals' => $constraints]); |
|
| 152 | + return view('manteniments/providers/index', [ 'providers' => $providers, 'searchingVals' => $constraints ]); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | private function doSearchingQuery($constraints) |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $index = 0; |
| 160 | 160 | foreach ($constraints as $constraint) { |
| 161 | 161 | if ($constraint != null) { |
| 162 | - $query = $query->where($fields[$index], 'like', '%'.$constraint.'%'); |
|
| 162 | + $query = $query->where($fields[ $index ], 'like', '%' . $constraint . '%'); |
|
| 163 | 163 | } |
| 164 | 164 | $index++; |
| 165 | 165 | } |
@@ -8,14 +8,14 @@ discard block |
||
| 8 | 8 | class MoneySourceController extends Controller |
| 9 | 9 | { |
| 10 | 10 | /** |
| 11 | - * Display a listing of the resource. |
|
| 12 | - * |
|
| 13 | - * @return \Illuminate\Http\Response |
|
| 14 | - */ |
|
| 15 | - public function __construct() |
|
| 16 | - { |
|
| 17 | - $this->middleware('auth'); |
|
| 18 | - } |
|
| 11 | + * Display a listing of the resource. |
|
| 12 | + * |
|
| 13 | + * @return \Illuminate\Http\Response |
|
| 14 | + */ |
|
| 15 | + public function __construct() |
|
| 16 | + { |
|
| 17 | + $this->middleware('auth'); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | 20 | public function index() |
| 21 | 21 | { |
@@ -45,12 +45,12 @@ discard block |
||
| 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'], |
|
| 53 | - ]); |
|
| 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 | + ]); |
|
| 54 | 54 | |
| 55 | 55 | return redirect()->intended('mnt/moneySource'); |
| 56 | 56 | } |
@@ -77,10 +77,10 @@ discard block |
||
| 77 | 77 | public function edit($id) |
| 78 | 78 | { |
| 79 | 79 | $moneySource = MoneySource::find($id); |
| 80 | - // Redirect to country list if updating country wasn't existed |
|
| 81 | - if ($moneySource == null || count($moneySource) == 0) { |
|
| 82 | - return redirect()->intended('/mnt/moneySource'); |
|
| 83 | - } |
|
| 80 | + // Redirect to country list if updating country wasn't existed |
|
| 81 | + if ($moneySource == null || count($moneySource) == 0) { |
|
| 82 | + return redirect()->intended('/mnt/moneySource'); |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | 85 | return view('manteniments/moneySource/edit', ['moneySource' => $moneySource]); |
| 86 | 86 | } |
@@ -102,12 +102,12 @@ discard block |
||
| 102 | 102 | 'description' => $request['description'], |
| 103 | 103 | 'date_entrance' => $request['date_entrance'], |
| 104 | 104 | 'last_update' => $request['last_update'], |
| 105 | - ]; |
|
| 105 | + ]; |
|
| 106 | 106 | $this->validate($request, [ |
| 107 | - 'name' => 'required|max:60', |
|
| 108 | - ]); |
|
| 107 | + 'name' => 'required|max:60', |
|
| 108 | + ]); |
|
| 109 | 109 | MoneySource::where('id', $id) |
| 110 | - ->update($input); |
|
| 110 | + ->update($input); |
|
| 111 | 111 | |
| 112 | 112 | return redirect()->intended('mnt/moneySource'); |
| 113 | 113 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('brand', function (Blueprint $table) { |
|
| 16 | + Schema::create('brand', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('name', 120); |
| 19 | 19 | $table->string('shortName', 50); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('studies', function (Blueprint $table) { |
|
| 16 | + Schema::create('studies', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->timestamps(); |
| 19 | 19 | }); |