Commit 72f8d1d5 authored by Julien Sailly's avatar Julien Sailly
Browse files

feat: adding and displaying the data

parent 98c5aeef
Loading
Loading
Loading
Loading
+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>
+6 −2
Original line number Diff line number Diff line
<?php

use App\Models\DivingSession;
use Illuminate\Support\Facades\Route;

/*
@@ -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]);
});