Loading app/Http/Controllers/DiveSesssionUpdate.php→app/Http/Controllers/DiveSessionUpdate.php +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ use App\Models\DivingSession; use Illuminate\Http\Request; class DiveSesssionUpdate extends Controller class DiveSessionUpdate extends Controller { //Update a diving session public static function update($request, $id) Loading resources/views/dives.blade.php +1 −1 Original line number Diff line number Diff line <x-layout> <link rel="stylesheet" href="/css/drop-down.css"> <x-page-title>Inscription aux plongées</x-page-title> <x-page-title>Liste des plongées</x-page-title> <div class="shadow-md max-w-full rounded-lg overflow-hidden border-2"> <table class="text-sm text-left text-gray-500 w-full"> <thead class="text-xs text-gray-700 uppercase bg-gray-50"> Loading routes/web.php +74 −26 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ use App\Models\DivingSession; use App\Http\Controllers\DivingSignUpController; use App\Http\Controllers\DiveSessionCreation; use App\Http\Controllers\DiveSesssionUpdate; use App\Http\Controllers\DiveSessionUpdate; use App\Http\Controllers\AuthController; use Illuminate\Support\Facades\Route; Loading @@ -23,41 +23,89 @@ */ use App\Models\User; use App\Models\DivingLocation; use App\Models\Boat; use App\Models\Prerogative; Route::get('/login', function () { Route::get('/login', function () { return view('login', ['wrongPassword' => false]); })->name('login'); Route::post('/login', [AuthController::class, 'login']); Route::get('/', function () { return view('welcome'); })->name('homepage'); Route::get('/logout', function () { session()->flush(); return redirect('/'); })->name('logout'); Route::middleware('App\Http\Middleware\rightChecker') ->get('/dives', [DivingSignUpController::class, 'show']) ->name('dives'); Route::get('/test', function() { return view('test'); }); Route::post('/login', function (Request $request) { $request->validate([ 'mail' => 'required|email', 'password' => 'required', Route::middleware('App\Http\Middleware\rightChecker') ->get('/dives/list-divers/{id}', function($id){ return view('divingSessions.showParticipants', [ 'users' => DivingSession::find($id)->getParticipants() ]); }); $user = User::where('US_EMAIL', $request->mail)->first(); if($user == null) { return view('login', ['wrongPassword' => true]); } if($user->checkPassword($request->password)) Route::middleware('App\Http\Middleware\rightChecker') ->get('/dives/{ds_code}', [DivingSignUpController::class, 'index']); Route::middleware('App\Http\Middleware\rightChecker') ->get('/create/dive', function() { return redirect('/'); // TODO: Redirect to the user's hub page } else return view('create_dive', ['locations' => DivingLocation::all(), 'boats' => Boat::all(), 'levels' => Prerogative::all(), 'users' => User::all()]); }); Route::middleware('App\Http\Middleware\rightChecker') ->post('/create/dive', function(Request $request) { return view('login', ['wrongPassword' => true]); } $pre = DiveSessionCreation::add($request); return view('create_dive', ['locations' => DivingLocation::all(), 'boats' => Boat::all(), 'levels' => Prerogative::all(), 'users' => User::all(), 'precedent' => $pre]); }); Route::get('/', function () { return view('welcome'); })->name('homepage'); Route::get('/tewst2', function(){ return view('drag_and_drop'); }); Route::get('/dives', [DivesList::class, 'index']); Route::get('/test', function() { return view('test', ['user' => User::find(1)]); Route::middleware('App\Http\Middleware\rightChecker') ->get('/dive/update/{id}', function($id){ return view('update_dive', ['dive' => DivingSession::find($id), 'locations' => DivingLocation::all(), 'boats' => Boat::all(), 'levels' => Prerogative::all(), 'users' => User::all()]); }); Route::post('/dive/update/{id}', function($id, Request $request){ DiveSessionUpdate::update($request, $id); return redirect('/'); }); Route::middleware('App\Http\Middleware\rightChecker') ->post('/dive/disable/{id}', function ($id){ DivingSession::find($id)->disable(); return redirect('/'); }); Route::get('/sessions', [DiversBySession::class,'getAllSessions']); Route::get('/session/{ds_code}', [DiversBySession::class,'getDiversBySession']); Route::get('/divings', [DivingNumberController::class, 'index']); Route::get('/alldivings', [DivingNumberController::class, 'allIndex']); Route::get('/alldivings?{afterthe}&{beforethe}', [DivingNumberController::class, 'filteredSearch({afterthe}, {beforethe})']); No newline at end of file Loading
app/Http/Controllers/DiveSesssionUpdate.php→app/Http/Controllers/DiveSessionUpdate.php +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ use App\Models\DivingSession; use Illuminate\Http\Request; class DiveSesssionUpdate extends Controller class DiveSessionUpdate extends Controller { //Update a diving session public static function update($request, $id) Loading
resources/views/dives.blade.php +1 −1 Original line number Diff line number Diff line <x-layout> <link rel="stylesheet" href="/css/drop-down.css"> <x-page-title>Inscription aux plongées</x-page-title> <x-page-title>Liste des plongées</x-page-title> <div class="shadow-md max-w-full rounded-lg overflow-hidden border-2"> <table class="text-sm text-left text-gray-500 w-full"> <thead class="text-xs text-gray-700 uppercase bg-gray-50"> Loading
routes/web.php +74 −26 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ use App\Models\DivingSession; use App\Http\Controllers\DivingSignUpController; use App\Http\Controllers\DiveSessionCreation; use App\Http\Controllers\DiveSesssionUpdate; use App\Http\Controllers\DiveSessionUpdate; use App\Http\Controllers\AuthController; use Illuminate\Support\Facades\Route; Loading @@ -23,41 +23,89 @@ */ use App\Models\User; use App\Models\DivingLocation; use App\Models\Boat; use App\Models\Prerogative; Route::get('/login', function () { Route::get('/login', function () { return view('login', ['wrongPassword' => false]); })->name('login'); Route::post('/login', [AuthController::class, 'login']); Route::get('/', function () { return view('welcome'); })->name('homepage'); Route::get('/logout', function () { session()->flush(); return redirect('/'); })->name('logout'); Route::middleware('App\Http\Middleware\rightChecker') ->get('/dives', [DivingSignUpController::class, 'show']) ->name('dives'); Route::get('/test', function() { return view('test'); }); Route::post('/login', function (Request $request) { $request->validate([ 'mail' => 'required|email', 'password' => 'required', Route::middleware('App\Http\Middleware\rightChecker') ->get('/dives/list-divers/{id}', function($id){ return view('divingSessions.showParticipants', [ 'users' => DivingSession::find($id)->getParticipants() ]); }); $user = User::where('US_EMAIL', $request->mail)->first(); if($user == null) { return view('login', ['wrongPassword' => true]); } if($user->checkPassword($request->password)) Route::middleware('App\Http\Middleware\rightChecker') ->get('/dives/{ds_code}', [DivingSignUpController::class, 'index']); Route::middleware('App\Http\Middleware\rightChecker') ->get('/create/dive', function() { return redirect('/'); // TODO: Redirect to the user's hub page } else return view('create_dive', ['locations' => DivingLocation::all(), 'boats' => Boat::all(), 'levels' => Prerogative::all(), 'users' => User::all()]); }); Route::middleware('App\Http\Middleware\rightChecker') ->post('/create/dive', function(Request $request) { return view('login', ['wrongPassword' => true]); } $pre = DiveSessionCreation::add($request); return view('create_dive', ['locations' => DivingLocation::all(), 'boats' => Boat::all(), 'levels' => Prerogative::all(), 'users' => User::all(), 'precedent' => $pre]); }); Route::get('/', function () { return view('welcome'); })->name('homepage'); Route::get('/tewst2', function(){ return view('drag_and_drop'); }); Route::get('/dives', [DivesList::class, 'index']); Route::get('/test', function() { return view('test', ['user' => User::find(1)]); Route::middleware('App\Http\Middleware\rightChecker') ->get('/dive/update/{id}', function($id){ return view('update_dive', ['dive' => DivingSession::find($id), 'locations' => DivingLocation::all(), 'boats' => Boat::all(), 'levels' => Prerogative::all(), 'users' => User::all()]); }); Route::post('/dive/update/{id}', function($id, Request $request){ DiveSessionUpdate::update($request, $id); return redirect('/'); }); Route::middleware('App\Http\Middleware\rightChecker') ->post('/dive/disable/{id}', function ($id){ DivingSession::find($id)->disable(); return redirect('/'); }); Route::get('/sessions', [DiversBySession::class,'getAllSessions']); Route::get('/session/{ds_code}', [DiversBySession::class,'getDiversBySession']); Route::get('/divings', [DivingNumberController::class, 'index']); Route::get('/alldivings', [DivingNumberController::class, 'allIndex']); Route::get('/alldivings?{afterthe}&{beforethe}', [DivingNumberController::class, 'filteredSearch({afterthe}, {beforethe})']); No newline at end of file