added badge at audit action

This commit is contained in:
Jagad R R
2025-01-01 17:20:37 +07:00
parent d4bbe3a602
commit b4b95d2d93
3 changed files with 21 additions and 7 deletions
@@ -38,8 +38,8 @@
<tr>
<th width="5%">{{ __('User') }}</th>
<th width="5%">{{ __('Ip Address') }}</th>
<th width="15%">{{ __('Action') }}</th>
<th width="5%">{{ __('Activity') }}</th>
<th width="5%">{{ __('Action') }}</th>
<th width="15%">{{ __('Activity') }}</th>
<th width="5%">Browser</th>
<th width="15%">User Agent</th>
</tr>
@@ -48,10 +48,24 @@
@foreach ($data as $item)
<tr>
<td>
{{ $item->user ? $item->user->name : preg_replace('/\).*$/', '', explode('(', $item->action)[1]) }}
{{ $item->user ? $item->user->name : preg_replace('/\).*$/', '', explode('(', $item->activity)[1]) }}
</td>
<td>{{ $item->ip_address }}</td>
<td>{{ $item->action }}</td>
<td>
@php
$color = 'info';
if ($item->action == 'Create') {
$color = 'success';
} elseif ($item->action == 'Update') {
$color = 'warning';
} elseif ($item->action == 'Delete') {
$color = 'danger';
}
@endphp
<div class="badge badge-{{ $color }} text-white">
{{ $item->action }}
</div>
</td>
<td>{{ $item->activity }}</td>
<td>{{ $item->browser }}</td>
<td>{{ $item->user_agent }}</td>