예제 #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($trip)
 {
     $flights = Trip::find($trip->id)->flights()->get();
     $array = array("trip" => $trip, "associated flights" => array("content" => $flights));
     return $array;
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int        $id
  * @return Redirect
  */
 public function destroy($id)
 {
     try {
         Trip::find($id)->delete();
         $flashMessage = 'Deleted trip.';
     } catch (Exception $e) {
         $flashMessage = $e->getMessage();
     }
     return Redirect::to('/admin/trips/')->with('flashMessage', $flashMessage);
 }