@extends('layouts.template.main') @push('styles') @endpush @section('title', 'Lịch sử thay đổi - Project Follow LVT') @section('content')
{{-- ===== FILTER ===== --}}
{{-- ===== STATS ===== --}} @php $totalCount = $logs->total(); @endphp
{{ number_format($totalCount) }} bản ghi
@foreach ($actions as $key => $info) @php $cnt = $logs->getCollection()->where('action', $key)->count(); @endphp @if ($cnt > 0)
{{ $cnt }} {{ $info['label'] }}
@endif @endforeach
{{-- ===== TABLE ===== --}}
@forelse ($logs as $log) @php $actionInfo = \App\Models\AppActivityLog::ACTION_LABELS[$log->action] ?? [ 'label' => $log->action, 'color' => '#64748b', 'icon' => 'activity', ]; $initials = collect(explode(' ', $log->user_name ?? '?')) ->map(fn($w) => strtoupper(substr($w, 0, 1))) ->take(2) ->implode(''); @endphp @empty @endforelse
Thời gian Người thực hiện App Thao tác Cột / Trường Giá trị thay đổi
{{ $log->created_at->format('d/m/Y H:i:s') }}
{{ $log->created_at->diffForHumans() }}
{{ $initials }}
{{ $log->user_name ?? 'N/A' }}
@if ($log->user)
{{ $log->user->role }}
@endif
{{ $log->app_name }}
{{--
#{{ $log->app_id }}
--}}
{{ $actionInfo['label'] }} @if ($log->field_name) {{ \App\Models\AppActivityLog::FIELD_LABELS[$log->field_name] ?? $log->field_name }} @else — @endif @if ($log->old_value !== null || $log->new_value !== null)
@if ($log->old_value !== null) {{ $log->old_value }} → @endif @if ($log->new_value !== null) {{ $log->new_value }} @endif
@else — @endif
Chưa có lịch sử nào
Các thay đổi trên Project Follow LVT sẽ hiển thị ở đây.
@if ($logs->hasPages())
Hiển thị {{ $logs->firstItem() }}–{{ $logs->lastItem() }} / {{ number_format($logs->total()) }} bản ghi
{{ $logs->links('pagination::bootstrap-5') }}
@endif
@push('scripts') @endpush @endsection