コード例 #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $spares = Spares::find($id);
     $spares->delete();
     // redirect
     Session::flash('message', 'Successfully deleted the spares!');
     return Redirect::to('spares');
 }
コード例 #2
0
 public function sparedetail($id)
 {
     if ($id) {
         $spares = Spares::find($id);
         // show the view and pass the spares to it
         return View::make('spares.sparedetail')->with('spares', $spares);
     }
 }