Loading app/Http/Controllers/DivesList.php +6 −2 Original line number Diff line number Diff line Loading @@ -3,15 +3,19 @@ namespace App\Http\Controllers; use App\Models\DivingSession; use App\Models\Prerogative; use App\Models\User; use Error; use Illuminate\View\View; class DivesList extends Controller { function index(): View { $dives = DivingSession::select('DS_CODE', 'CAR_DIVING_SESSION.DL_ID', 'DS_DATE', 'DL_DEPTH', 'CAR_SCHEDULE', 'DL_NAME') $dives = DivingSession::select('DS_CODE', 'CAR_DIVING_SESSION.DL_ID', 'DS_DATE', 'DL_DEPTH', 'CAR_SCHEDULE', 'DL_NAME', 'DS_MAX_DEPTH') ->join('CAR_DIVING_LOCATION', 'CAR_DIVING_SESSION.DL_ID', '=', 'CAR_DIVING_LOCATION.DL_ID') ->get(); return view('dives', ['dives' => $dives]); $user = session()->get('user'); return view('dives', ['dives' => $dives, 'userPre' => Prerogative::find($user->PRE_CODE)]); } } resources/views/dives.blade.php +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ <td class="px-6 py-4">{{ $dive->DL_NAME }}</td> <td class="px-8 py-4"> <a href='/dives/{{$dive->DS_CODE}}'> @if($userPre->PRE_MAX_DEPTH>$dive->DS_MAX_DEPTH) <x-button color="bg-green-700" colorHover="hover:bg-green-800"> <svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 12"> Loading @@ -28,6 +29,7 @@ stroke-width="2" d="M1 5.917 5.724 10.5 15 1.5"/> </svg> </x-button> @endif </a> <x-button diveId="dropdownButton-{{$dive->DS_CODE}}"> <svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" Loading Loading
app/Http/Controllers/DivesList.php +6 −2 Original line number Diff line number Diff line Loading @@ -3,15 +3,19 @@ namespace App\Http\Controllers; use App\Models\DivingSession; use App\Models\Prerogative; use App\Models\User; use Error; use Illuminate\View\View; class DivesList extends Controller { function index(): View { $dives = DivingSession::select('DS_CODE', 'CAR_DIVING_SESSION.DL_ID', 'DS_DATE', 'DL_DEPTH', 'CAR_SCHEDULE', 'DL_NAME') $dives = DivingSession::select('DS_CODE', 'CAR_DIVING_SESSION.DL_ID', 'DS_DATE', 'DL_DEPTH', 'CAR_SCHEDULE', 'DL_NAME', 'DS_MAX_DEPTH') ->join('CAR_DIVING_LOCATION', 'CAR_DIVING_SESSION.DL_ID', '=', 'CAR_DIVING_LOCATION.DL_ID') ->get(); return view('dives', ['dives' => $dives]); $user = session()->get('user'); return view('dives', ['dives' => $dives, 'userPre' => Prerogative::find($user->PRE_CODE)]); } }
resources/views/dives.blade.php +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ <td class="px-6 py-4">{{ $dive->DL_NAME }}</td> <td class="px-8 py-4"> <a href='/dives/{{$dive->DS_CODE}}'> @if($userPre->PRE_MAX_DEPTH>$dive->DS_MAX_DEPTH) <x-button color="bg-green-700" colorHover="hover:bg-green-800"> <svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 12"> Loading @@ -28,6 +29,7 @@ stroke-width="2" d="M1 5.917 5.724 10.5 15 1.5"/> </svg> </x-button> @endif </a> <x-button diveId="dropdownButton-{{$dive->DS_CODE}}"> <svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" Loading