public function reservation($id) { $reservation = Reservation::findOrFail($id); if ($this->user->id == $reservation->user_id) { $transaction = Transaction::where('reservation_id', $reservation->id)->first(); $pdf = storage_path() . '/reservations/reservation-' . $transaction->reference_number . '.pdf'; if (file_exists($pdf)) { return Response::download($pdf); } else { return Redirect::to('clients')->with('error', 'PDF was not found.'); } } else { return App::abort(404); } }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $reservation = $this->reservation->findOrFail($id); $property = Property::findOrFail($reservation->property_id); return View::make('admin.reservations.show', compact('reservation', 'property')); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $reservation = Reservation::findOrFail($id); $reservation->delete(); return Redirect::back()->with('success', 'Reservatie successvol geannuleerd'); }