feat:add index and logs blade
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
@extends('admin.layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid pt-4">
|
||||
|
||||
<div class="card custom-card">
|
||||
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
تاریخچهی تغییرات: {{ $flight->title }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div class="table-responsive">
|
||||
|
||||
<table class="table table-bordered">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>عملیات</th>
|
||||
<th>کاربر</th>
|
||||
<th>تاریخ</th>
|
||||
<th>تغییرات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@forelse($logs as $log)
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
@if($log->action === 'created')
|
||||
<span class="badge bg-success">ایجاد</span>
|
||||
@else
|
||||
<span class="badge bg-primary">ویرایش</span>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ $log->admin?->first_name }}
|
||||
{{ $log->admin?->last_name }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ $log->created_at->format('Y-m-d H:i') }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if($log->action === 'updated')
|
||||
<ul class="mb-0 ps-3">
|
||||
@foreach($log->changes as $field => $value)
|
||||
<li>
|
||||
<strong>{{ $field }}:</strong>
|
||||
{{ $value['old'] }}
|
||||
←
|
||||
{{ $value['new'] }}
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@else
|
||||
ایجاد رکورد جدید
|
||||
@endif
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@empty
|
||||
|
||||
<tr>
|
||||
<td colspan="4" class="text-center">
|
||||
هیچ لاگی ثبت نشده است.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
{{ $logs->links() }}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
Reference in New Issue
Block a user