Bericht für alte Touren schreiben
This commit is contained in:
parent
e6f3767e33
commit
293c2c535f
6 changed files with 88 additions and 38 deletions
|
|
@ -114,11 +114,17 @@ class TourController extends Controller
|
|||
$user=User::find($booking->user_id);
|
||||
array_push($users, $user);
|
||||
}
|
||||
if($tour->start<Carbon::now()) {
|
||||
return view('tour.show_old')
|
||||
->with('tour', $tour)
|
||||
->with('users', $users)
|
||||
->with('creator', $creator);
|
||||
}
|
||||
|
||||
return view('tour.show')
|
||||
->with('tour',$tour)
|
||||
->with('tour', $tour)
|
||||
->with('users', $users)
|
||||
->with('creator', $creator);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -130,7 +136,10 @@ class TourController extends Controller
|
|||
public function edit(Tour $tour)
|
||||
{
|
||||
error_log("Tour:edit");
|
||||
return view('tour.edit')->with('tour',$tour);
|
||||
if ($tour->start<Carbon::now()) {
|
||||
return view('tour.edit_old')->with('tour', $tour);
|
||||
}
|
||||
return view('tour.edit')->with('tour', $tour);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -149,7 +158,6 @@ class TourController extends Controller
|
|||
[
|
||||
'tour_id' => 'required',
|
||||
'name'=>'required|min:3',
|
||||
'beschreibung'=>'required',
|
||||
'user_id'=>'required',
|
||||
'bild'=>'mimes:jpg,jpeg,bmp,png,gif'
|
||||
]
|
||||
|
|
@ -177,12 +185,12 @@ class TourController extends Controller
|
|||
}
|
||||
|
||||
$tour->name=$request->input('name');
|
||||
$tour->beschreibung=$request->input('beschreibung');
|
||||
$tour->start=$request->input('start');
|
||||
$tour->deadline=$request->input('deadline');
|
||||
$tour->max_participants=$request->input('max_participants');
|
||||
$tour->is_cancelled=$request->input('is_cancelled',false);
|
||||
|
||||
if ($request->beschreibung) $request->input('beschreibung');
|
||||
if ($request->start) $tour->start=$request->input('start');
|
||||
if ($request->deadline) $tour->deadline=$request->input('deadline');
|
||||
if ($request->max_participants) $tour->max_participants=$request->input('max_participants');
|
||||
if ($request->is_cancelled) $tour->is_cancelled=$request->input('is_cancelled',false);
|
||||
if ($request->bericht) $tour->bericht=$request->bericht;
|
||||
$tour->save();
|
||||
|
||||
return redirect('/tour');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue