@extends('layouts.app') @section('title', 'Login History') @section('page', 'logs') @php $statusVariant = fn ($s) => match ($s) { 'success' => 'success', 'failed' => 'danger', 'inactive' => 'warning', 'locked' => 'warning', default => 'neutral', }; $statusLabel = fn ($s) => match ($s) { 'success' => 'Success', 'failed' => 'Failed', 'inactive' => 'Inactive', 'locked' => 'Locked', default => ucfirst((string) $s), }; @endphp @section('content') @if (session('success')) {{ session('success') }} @endif @if ($errors->any()) {{ $errors->first() }} @endif @if ($canManage ?? false) @csrf Clear History @endif All Statuses Success Failed Inactive Locked Total {{ $histories->count() }} Recent login events Success {{ $successCount }} Signed in Failed {{ $failedCount }} Blocked / wrong password @forelse ($histories as $row) {{ $row->logged_in_at?->format('Y-m-d H:i:s') ?? '—' }} {{ $row->user?->name ?? '—' }} {{ $row->email ?: '—' }} {{ $row->ip_address ?: '—' }} {{ $statusLabel($row->status) }} @empty No login history yet. @endforelse @endsection @push('styles') @endpush @push('scripts') @endpush
Total
{{ $histories->count() }}
Recent login events
Success
{{ $successCount }}
Signed in
Failed
{{ $failedCount }}
Blocked / wrong password