38 lines
1.6 KiB
PHP
38 lines
1.6 KiB
PHP
@php $alerts = \cache()->remember('alerts', 300, fn () => \App\Models\Alert::latest()->get()); @endphp
|
|
|
|
@foreach($alerts as $alert)
|
|
<div class="mx-auto pt-2 sm:px-6 lg:px-8 space-y-6 max-w-[100%] xl:max-w-[95%] 2xl:max-w-[85%] relative z-10">
|
|
@if ($alert->type == 0)
|
|
<div class="mb-4 rounded-lg bg-success-400 px-6 py-5 text-base text-success-800 mt-5" role="alert">
|
|
{{ $alert->text }}
|
|
@auth
|
|
@if(Auth::user()->is_admin)
|
|
<form method="POST" action="{{ route('admin.alert.delete', $alert->id) }}" class="float-right hover:text-success-900">
|
|
@csrf
|
|
@method('delete')
|
|
<button type="submit" class="cursor-pointer transition duration-150 ease-in-out" data-te-ripple-init data-te-ripple-color="light">
|
|
<i class="fa-solid fa-xmark"></i>
|
|
</button>
|
|
</form>
|
|
@endif
|
|
@endauth
|
|
</div>
|
|
@elseif ($alert->type == 1)
|
|
<div class="mb-4 rounded-lg bg-danger-400 px-6 py-5 text-base text-danger-800 mt-5" role="alert">
|
|
{{ $alert->text }}
|
|
@auth
|
|
@if(Auth::user()->is_admin)
|
|
<form method="POST" action="{{ route('admin.alert.delete', $alert->id) }}" class="float-right hover:text-danger-900">
|
|
@csrf
|
|
@method('delete')
|
|
<button type="submit" class="cursor-pointer transition duration-150 ease-in-out" data-te-ripple-init data-te-ripple-color="light">
|
|
<i class="fa-solid fa-xmark"></i>
|
|
</button>
|
|
</form>
|
|
@endif
|
|
@endauth
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@endforeach
|