| @@ 108-125 (lines=18) @@ | ||
| 105 | * |
|
| 106 | * @return \Illuminate\Http\Response |
|
| 107 | */ |
|
| 108 | public function edit($id) |
|
| 109 | { |
|
| 110 | $inventory = Inventory::find($id); |
|
| 111 | // Redirect to state list if updating state wasn't existed |
|
| 112 | if ($inventory == null || count($inventory) == 0) { |
|
| 113 | return redirect()->intended('/inventory-mnt'); |
|
| 114 | } |
|
| 115 | ||
| 116 | $material_types = Material_type::all(); |
|
| 117 | $brands = Brand::all(); |
|
| 118 | $brand_models = Brand_model::all(); |
|
| 119 | $moneySources = MoneySource::all(); |
|
| 120 | $locations = Location::all(); |
|
| 121 | $providers = Provider::all(); |
|
| 122 | ||
| 123 | return view('inventory/edit', ['inventory' => $inventory, 'material_types' => $material_types, 'brands' => $brands, 'brand_models' => $brand_models, 'moneySources' => $moneySources, |
|
| 124 | 'locations' => $locations, 'providers' => $providers, ]); |
|
| 125 | } |
|
| 126 | ||
| 127 | /** |
|
| 128 | * Update the specified resource in storage. |
|
| @@ 109-126 (lines=18) @@ | ||
| 106 | * |
|
| 107 | * @return \Illuminate\Http\Response |
|
| 108 | */ |
|
| 109 | public function edit($id) |
|
| 110 | { |
|
| 111 | $inventory = Inventory::find($id); |
|
| 112 | // Redirect to state list if updating state wasn't existed |
|
| 113 | if ($inventory == null || count($inventory) == 0) { |
|
| 114 | return redirect()->intended('/inventory-mnt'); |
|
| 115 | } |
|
| 116 | ||
| 117 | $material_types = Material_type::all(); |
|
| 118 | $brands = Brand::all(); |
|
| 119 | $brand_models = Brand_model::all(); |
|
| 120 | $moneySources = MoneySource::all(); |
|
| 121 | $locations = Location::all(); |
|
| 122 | $providers = Provider::all(); |
|
| 123 | ||
| 124 | return view('inventory/edit', ['inventory' => $inventory, 'material_types' => $material_types, 'brands' => $brands, 'brand_models' => $brand_models, |
|
| 125 | 'moneySources' => $moneySources, 'locations'=> $locations, 'providers' => $providers, ]); |
|
| 126 | } |
|
| 127 | ||
| 128 | /** |
|
| 129 | * Update the specified resource in storage. |
|