@extends('layouts.admin-master') @section('title', 'Audit Logs') @section('style') @include('admin.style') @endsection @section('content')
@include('admin.header')

Audit Logs

{{-- Filters --}}
Reset
Activity Trail
{{ $logs->total() }} entries
@forelse($logs as $index => $log) @php $action = strtolower($log->action ?? ''); if (str_contains($action, 'reject') || str_contains($action, 'delete') || str_contains($action, 'suspend')) { $badge = 'badge-rejected'; } elseif (str_contains($action, 'approve') || str_contains($action, 'accept') || str_contains($action, 'verif')) { $badge = 'badge-approved'; } elseif (str_contains($action, 'counter') || str_contains($action, 'updat') || str_contains($action, 'creat')) { $badge = 'badge-countered'; } else { $badge = 'badge-active'; } $model = strtolower($log->model_type ?? ''); $modelClass = str_contains($model, 'farmer') ? 'farmer' : (str_contains($model, 'vendor') ? 'vendor' : 'other'); $modelIcon = str_contains($model, 'farmer') ? 'lni-user' : (str_contains($model, 'vendor') ? 'lni-store' : 'lni-layers'); $adminName = $log->admin->name ?? 'System'; @endphp @empty @endforelse
#
Admin
Action
Model
ID
Description
IP Address
Date
{{ ($logs->firstItem() ?? 1) + $index }} {{ strtoupper(substr($adminName, 0, 1)) }} {{ $adminName }} {{ $log->action }} @if($log->model_type) {{ class_basename($log->model_type) }} @else @endif {{ $log->model_id ?? '—' }} {{ $log->description }} {{ $log->ip_address ?? '—' }}
{{ $log->created_at->format('d M Y') }}
{{ $log->created_at->format('h:i A') }}

No audit logs found

Showing {{ $logs->firstItem() ?? 0 }} – {{ $logs->lastItem() ?? 0 }} of {{ $logs->total() }} entries

{{ $logs->appends(request()->query())->links('pagination::bootstrap-4') }}
@include('admin.footer')
@section('script') @include('admin.script') @endsection @endsection