示例#1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     // Find the Cartridge
     $cartridge = Cartridge::find($id);
     // Update data
     $cartridge->size = $request->size;
     $cartridge->label = $request->label;
     // Save it
     $cartridge->save();
     session()->flash('message', 'Cartridge has been saved');
     session()->flash('message-type', 'success');
     return Redirect('cartridges');
 }
示例#2
0
 public function showManufacturers($manufacturer)
 {
     return view('bullets.index', ['cartridges' => Cartridge::all(), 'bullets' => Bullet::where('manufacturer', $manufacturer)->get(), 'sort' => 'inventory']);
 }