@extends('template.layouts.template-base') @section('title', 'Notifications') @section('styles') @endsection @section('content') {{-- Header --}} Notifications {{-- Show when NOT in delete mode --}} Delete {{-- Show when IN delete mode --}} Delete Selected - 0 {{-- Cancel button (delete mode) --}} Cancel @csrf Mark all as Read {{-- Main Container --}} {{-- Tab Navigation --}} @php $tabs = [ 'order' => 'Order', 'payment' => 'Payment', 'low_stock' => 'Inventory', 'new_user' => 'New User', ]; @endphp @foreach($tabs as $key => $label) {{ $label }} @if(($unreadCounts[$key] ?? 0) > 0) ({{ $unreadCounts[$key] }}) @else (0) @endif @endforeach {{-- Notification List --}} @forelse($notifications as $date => $group) @if($date !== 'Today') {{ $date }} @endif @foreach($group as $notification) {{ strtoupper(substr($notification->type, 0, 1)) }} {{ $notification->title }} {{ $notification->created_at->format('h:i A') }} {{ $notification->message }} @endforeach @empty No {{ $tabs[$type] ?? '' }} notifications found. @endforelse {{-- Delete Confirm Modal --}}
{{ $notification->message }}
Are you sure you want to delete these notifications? This action cannot be undone.
Notifications deleted successfully.