/** * Request user input * create passenger * save belongsto relationship with Booking model. * * @param $request [request all user input] * @param $id [get booking id] */ public function addBookingDetail($request, $id) { $booking = $this->booking->getById($id); $givenInput = $request->all(); $data = $this->model->create($givenInput); $booking->passenger()->save($data); }
/** * Remove the specified resource from storage. * * @param int $id * * @return \Illuminate\Http\Response */ public function destroy($id) { $this->booking->deleteByid($id); \Session::flash('flash_message', 'Booking has been deleted'); return redirect()->back(); }