fix: little oops

This commit is contained in:
Nicholas Ciechanowski 2023-10-07 22:51:34 +11:00
parent 0ec936088e
commit 87b1edbdca
2 changed files with 4 additions and 4 deletions

View File

@ -10,11 +10,11 @@ class RequestQuotePolicy
public function approve(): bool public function approve(): bool
{ {
return auth()->user()->is_admin; return !empty(auth()->user()) && auth()->user()->is_admin;
} }
public function reject(): bool public function reject(): bool
{ {
return auth()->user()->is_admin; return !empty(auth()->user()) && auth()->user()->is_admin;
} }
} }

View File

@ -55,7 +55,7 @@ new #[Layout('layouts.guest')] class extends Component
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-nexi-black dark:text-gray-200 sm:pl-6"> class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-nexi-black dark:text-gray-200 sm:pl-6">
Requested Quotes Requested Quotes
</th> </th>
@if(auth()->user()->is_admin) @if(!empty(auth()->user()) && auth()->user()->is_admin)
<th scope="col"></th> <th scope="col"></th>
@endif @endif
</tr> </tr>
@ -66,7 +66,7 @@ new #[Layout('layouts.guest')] class extends Component
<td class="relative py-4 pl-4 pr-3 text-sm sm:pl-6 border-t text-nexi-black dark:text-gray-200"> <td class="relative py-4 pl-4 pr-3 text-sm sm:pl-6 border-t text-nexi-black dark:text-gray-200">
{{ $quote->quote }} {{ $quote->quote }}
</td> </td>
@if(auth()->user()->is_admin) @if(!empty(auth()->user()) && auth()->user()->is_admin)
<td class="relative w-8 pl-4 pr-3 text-sm sm:pl-6 border-t"> <td class="relative w-8 pl-4 pr-3 text-sm sm:pl-6 border-t">
<div class="flex flex-row space-x-2"> <div class="flex flex-row space-x-2">
<form wire:submit="approve({{ $quote }})"> <form wire:submit="approve({{ $quote }})">