@extends('layouts.admin') @section('title', 'Notificações') @section('breadcrumb')Notificações@endsection @push('styles') @endpush @section('content') @php $filter = request('filter', 'all'); @endphp

🔔 Central de Notificações

Histórico de alertas do sistema · {{ $unreadCount }} não {{ $unreadCount === 1 ? 'lida' : 'lidas' }}

@if($unreadCount > 0)
@csrf @method('PATCH')
@endif
{{-- Tabs --}}
Todas Não lidas ({{ $unreadCount }})
Notificações {{ $notifications->total() }} total · página {{ $notifications->currentPage() }}
@forelse($notifications as $n) @php $colors = $n->color; $iconColors = [ 'success' => '#16a34a', 'warning' => '#d97706', 'danger' => '#dc2626', 'info' => '#2563eb', ]; $iconColor = $iconColors[$n->type] ?? '#2563eb'; @endphp
{{-- Ícone --}}
{{-- Conteúdo --}}
{{ $n->title }}
@if($n->message)
{{ $n->message }}
@endif
{{ $n->created_at->format('d/m/Y H:i') }} · {{ $n->created_at->diffForHumans() }} @if($n->user) · {{ $n->user->display_name ?? $n->user->name }} @else · Sistema @endif
{{-- Ações --}}
@if(!$n->is_read)
@csrf @method('PATCH')
@else ✓ Lida @endif @if($n->link) Abrir → @endif
@empty
🔔
{{ $filter === 'unread' ? 'Nenhuma notificação não lida' : 'Nenhuma notificação encontrada' }}
As notificações aparecerão aqui conforme as atividades do hotel.
@endforelse
{{-- Paginação --}} @if($notifications->hasPages())
@if($notifications->onFirstPage()) @else @endif @foreach($notifications->getUrlRange(max(1,$notifications->currentPage()-2), min($notifications->lastPage(),$notifications->currentPage()+2)) as $page => $url) {{ $page }} @endforeach @if($notifications->hasMorePages()) @endif
@endif @endsection