@extends('layouts.app') @section('title', 'Logs del Sistema') @section('content')

Logs del Sistema

@forelse($logs as $log) @empty @endforelse
Nivel Módulo Mensaje Usuario IP Fecha Acciones
{{ strtoupper($log->level) }} {{ getLogModule($log) }}
{{ $log->message }}
{{ $log->user ? $log->user->name : 'Sistema' }} {{ $log->ip_address }} {{ $log->created_at->format('d/m/Y H:i') }}
No hay logs disponibles
@if($logs->hasPages())
{{ $logs->links() }}
@endif
@endsection @push('scripts') @endpush @php function getBadgeClass($level) { $classes = [ 'debug' => 'secondary', 'info' => 'info', 'notice' => 'primary', 'warning' => 'warning', 'error' => 'danger', 'critical' => 'danger', 'alert' => 'dark', 'emergency' => 'dark' ]; return $classes[$level] ?? 'secondary'; } function getLogModule($log) { $context = json_decode($log->context ?? '{}', true); return $context['module'] ?? $log->channel ?? 'Sistema'; } @endphp