Working on Gallery
This commit is contained in:
parent
0d5a612a99
commit
529b71d005
5 changed files with 315 additions and 4 deletions
|
|
@ -76,7 +76,6 @@
|
|||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
error_log("Tour:store");
|
||||
|
||||
$request->validate(
|
||||
[
|
||||
|
|
@ -112,18 +111,23 @@
|
|||
*/
|
||||
public function show(Tour $tour)
|
||||
{
|
||||
|
||||
Log::info("TourController::show triggered");
|
||||
|
||||
$creator = User::find($tour->user_id);
|
||||
$bookings = Booking::where('tour_id', $tour->id)->get();
|
||||
$users = array();
|
||||
foreach ($bookings as $booking) {
|
||||
$user = User::find($booking->user_id);
|
||||
array_push($users, $user);
|
||||
Log::info("Adding user with id $booking->user_id: $user");
|
||||
}
|
||||
|
||||
// Vergangene Tour anzeigen
|
||||
if ($tour->start < Carbon::now()) {
|
||||
$tour->start = Tour::toGermanDate($tour->start);
|
||||
$tour->deadline = Tour::toGermanDate($tour->deadline);
|
||||
|
||||
return view('tour.show_old')
|
||||
->with('tour', $tour)
|
||||
->with('users', $users)
|
||||
|
|
@ -135,6 +139,7 @@
|
|||
|
||||
$tour->start = Tour::toGermanDate($tour->start);
|
||||
$tour->deadline = Tour::toGermanDate($tour->deadline);
|
||||
|
||||
return view('tour.show')
|
||||
->with('tour', $tour)
|
||||
->with('users', $users)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue