Commit 79f79811 authored by Julien Ait azzouzene's avatar Julien Ait azzouzene
Browse files

feat: show participants functionnality from dives list

parent d3dfb0f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ class DivesList extends Controller
{
    function index(): View
    {
        $dives = DivingSession::select('car_diving_session.DL_ID', 'DS_DATE', 'DL_DEPTH', 'CAR_SCHEDULE', 'DL_NAME')
        $dives = DivingSession::select('car_diving_session.DL_ID', 'DS_DATE', 'DL_DEPTH', 'CAR_SCHEDULE', 'DL_NAME', 'DS_CODE')
            ->join('car_diving_location', 'car_diving_session.DL_ID', '=', 'car_diving_location.DL_ID')
            ->get();
        return view('dives', ['dives' => $dives]);
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
                    <td class="px-8 py-4">{{ $dive->DL_NAME }}</td>
                    <td class="px-8 py-4">
                        <button class="bg-green-400 hover:bg-green-500 focus:bg-green-500 text-black rounded-lg px-10 py-1.5">S'inscrire</button>
                        <button class="bg-yellow-400 hover:bg-yellow-500 focus:bg-yellow-500 text-black rounded-lg px-5 py-1.5">Voir les inscrits</button>
                        <a href="/dives/{{$dive->DS_CODE}}"><button class="bg-yellow-400 hover:bg-yellow-500 focus:bg-yellow-500 text-black rounded-lg px-5 py-1.5">Voir les inscrits</button></a>
                    </td>
                </tr>
            @endforeach
+7 −0
Original line number Diff line number Diff line
@@ -54,6 +54,13 @@
{
    return view('test', ['user' => User::find(1)]);
});

Route::get('/dives/{id}', function($id){
    return view('divingSessions.showParticipants', [
        'users' => DivingSession::find($id)->getParticipants()
    ]);
});

Route::get('/signup/{ds_code}', [DivingSignUpController::class, 'index']);

Route::get('/signup', [DivingSignUpController::class, 'show'])->name('signup');