@extends('layouts.exat') @section('title', 'Audit') @section('subtitle', $audits->total().' entrée(s)') @section('content') @php $libEvent = ['created' => 'Créé', 'updated' => 'Modifié', 'deleted' => 'Supprimé', 'restored' => 'Restauré']; $couleurEvent = ['created' => 'bg-emerald-50 text-emerald-700', 'updated' => 'bg-amber-50 text-amber-700', 'deleted' => 'bg-rose-50 text-rose-700', 'restored' => 'bg-slate-100 text-slate-600']; @endphp
@include('partials._filtre-date') @if(request()->hasAny(['event','type','periode','date','date_debut','date_fin','semaine','mois','annee'])) Réinitialiser @endif
@include('partials.th-tri', ['col' => 'date', 'label' => 'Date']) @include('partials.th-tri', ['col' => 'utilisateur', 'label' => 'Utilisateur']) @include('partials.th-tri', ['col' => 'action', 'label' => 'Action']) @include('partials.th-tri', ['col' => 'objet', 'label' => 'Objet']) @forelse($audits as $a) @empty @endforelse
Modifications
{{ $a->created_at?->format('d/m/Y H:i') }} {{ $a->user?->name ?? '—' }} {{ $libEvent[$a->event] ?? $a->event }} {{ class_basename($a->auditable_type) }} #{{ $a->auditable_id }} @php $new = $a->new_values ?? []; $old = $a->old_values ?? []; @endphp @if($a->event === 'updated' && count($new))
    @foreach($new as $champ => $valeur)
  • {{ $champ }} : {{ \Illuminate\Support\Str::limit((string)($old[$champ] ?? '—'), 40) }}{{ \Illuminate\Support\Str::limit((string) $valeur, 40) }}
  • @endforeach
@elseif($a->event === 'created') Création de l'enregistrement @elseif($a->event === 'deleted') Suppression de l'enregistrement @else @endif
Aucune entrée d'audit. Les journaux apparaissent au fil des créations et modifications.
@if($audits->hasPages())
{{ $audits->links() }}
@endif
@endsection