Loading resources/views/dives.blade.php +19 −4 Original line number Diff line number Diff line <x-layout> <h1>Liste des plongées</h1> <ul> @dump($dives) <table> <thead> <tr> <th>Date</th> <th>Plage horaire</th> <th>Niveau requis</th> <th>Lieu</th> </tr> </thead> <tbody> @foreach ($dives as $dive) <li>{{ $dive->date }} - {{ $dive->site }}</li> <tr> <td>{{ $dive->DS_DATE }}</td> <td>{{ $dive->CAR_SCHEDULE }}</td> <td>{{ $dive->DL_DEPTH }}</td> <td>{{ $dive->DL_NAME }}</td> </tr> @endforeach </ul> </tbody> </table> </x-layout> routes/web.php +6 −2 Original line number Diff line number Diff line <?php use App\Models\DivingSession; use Illuminate\Support\Facades\Route; /* Loading @@ -18,6 +19,9 @@ }); Route::get('/dives', function () { $dives = App\Models\Dive::all(); return view('dives'); $dives = DivingSession::select('car_diving_session.DL_ID', 'DS_DATE', 'DL_DEPTH', 'CAR_SCHEDULE', 'DL_NAME') ->join('car_diving_location', 'car_diving_session.DL_ID', '=', 'car_diving_location.DL_ID') ->get(); //$divers = return view('dives', ['dives' => $dives]); }); Loading
resources/views/dives.blade.php +19 −4 Original line number Diff line number Diff line <x-layout> <h1>Liste des plongées</h1> <ul> @dump($dives) <table> <thead> <tr> <th>Date</th> <th>Plage horaire</th> <th>Niveau requis</th> <th>Lieu</th> </tr> </thead> <tbody> @foreach ($dives as $dive) <li>{{ $dive->date }} - {{ $dive->site }}</li> <tr> <td>{{ $dive->DS_DATE }}</td> <td>{{ $dive->CAR_SCHEDULE }}</td> <td>{{ $dive->DL_DEPTH }}</td> <td>{{ $dive->DL_NAME }}</td> </tr> @endforeach </ul> </tbody> </table> </x-layout>
routes/web.php +6 −2 Original line number Diff line number Diff line <?php use App\Models\DivingSession; use Illuminate\Support\Facades\Route; /* Loading @@ -18,6 +19,9 @@ }); Route::get('/dives', function () { $dives = App\Models\Dive::all(); return view('dives'); $dives = DivingSession::select('car_diving_session.DL_ID', 'DS_DATE', 'DL_DEPTH', 'CAR_SCHEDULE', 'DL_NAME') ->join('car_diving_location', 'car_diving_session.DL_ID', '=', 'car_diving_location.DL_ID') ->get(); //$divers = return view('dives', ['dives' => $dives]); });