@extends('layouts.admin') @section('page-title') Gestion des notifications @endsection @section('page-subtitle') Créer et gérer les notifications pour le personnel @endsection @section('styles') @endsection @section('scripts') @endsection @section('content')
Actives
{{ $notifications->where('is_active', true)->count() }}
Expirées
{{ $notifications->filter(function($n) { return $n->expires_at && $n->expires_at->isPast(); })->count() }}
Inactives
{{ $notifications->where('is_active', false)->count() }}
Total notifications
{{ $notifications->total() }}
@if($notifications->count() > 0) @foreach($notifications as $notification)
{!! $notification->title !!}
Créée le {{ $notification->created_at->format('d/m/Y à H:i') }} @if($notification->expires_at) Expire le {{ $notification->expires_at->format('d/m/Y à H:i') }} @endif @if($notification->target_type === 'menage') Personnel ménage @elseif($notification->target_type === 'worker') Ouvriers @else Tous @endif
@if(!$notification->is_active) Inactive @elseif($notification->expires_at && $notification->expires_at->isPast()) Expirée @else Active @endif
{!! Str::limit($notification->content, 200) !!}
@if($notification->target_users) {{ count($notification->target_users) }} destinataire(s) spécifique(s) @else Tous les {{ $notification->target_type === 'menage' ? 'personnel ménage' : ($notification->target_type === 'worker' ? 'ouvriers' : 'utilisateurs') }} @endif
{{ $notification->reads->count() }} lecture(s)
@if($notification->is_active) @else @endif
@endforeach
{{ $notifications->links() }}
@else
Aucune notification

Commencez par créer votre première notification.

@endif
@endsection