Touranmeldung durchführen + zurückziehen

This commit is contained in:
TorstenS 2020-10-10 11:34:23 +02:00
parent 30cdeab510
commit 2f0a54ed77
6 changed files with 71 additions and 14 deletions

View file

@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Tour;
use App\Booking;
use Illuminate\Http\Request;
use Illuminate\Http\File;
use Illuminate\Support\Facades\Storage;
@ -177,4 +178,16 @@ class TourController extends Controller
//
}
public function join($tour_id) {
$user=Auth::user();
Tour::join($tour_id,$user->id);
return redirect('/tour');
}
public function cancelBooking($tour_id) {
$user=Auth::user();
Booking::where('tour_id', $tour_id)->where('user_id', $user->id)->delete();
return redirect('/tour');
}
}