Update Spatie versi 4

This commit is contained in:
2026-11-05 17:06:11 +07:00
parent b76fa9e59b
commit 9cdd178297
11 changed files with 167 additions and 69 deletions
@@ -2,7 +2,6 @@
@use('App\Services\Konfigurasi\FormatLogAktivitas', 'Format')
@use('App\Models\Pertanian\Petani')
@use('Illuminate\Support\Str')
@section('content')
<div class="container-xxl flex-grow-1 container-p-y">
@@ -75,10 +74,10 @@
@php
$j = $jenis[$item->log_name] ?? ['label' => $item->log_name ?? '-', 'warna' => 'secondary'];
$prop = $item->properties ?? collect();
$baru = $item->attribute_changes['attributes'] ?? [];
$lama = $item->attribute_changes['old'] ?? null;
$baru = $prop['attributes'] ?? [];
$lama = $prop['old'] ?? null;
$petaniId = $item->subject_type === Petani::class ? $item->subject_id : ($prop['petani_id'] ?? null);
$namaData = $item->subject?->nama ?? $item->subject?->name;
$namaData = $prop['label'] ?? null;
@endphp
<tr>
<td class="text-nowrap">
@@ -97,7 +96,7 @@
<td>
<span class="d-block">{{ $item->description }}</span>
@if ($item->subject_type && $item->subject_type !== Petani::class)
<small class="text-body-secondary d-block">#{{ $item->subject_id }}{{ $namaData ? ' · ' . Str::limit($namaData, 40) : '' }}</small>
<small class="text-body-secondary d-block">#{{ $item->subject_id }}{{ $namaData ? ' · ' . $namaData : '' }}</small>
@endif
@if ($petaniId)
<small class="text-body-secondary d-block">
@@ -154,7 +153,7 @@
</div>
<div class="d-flex justify-content-center justify-content-md-end border-top p-4">
{{ $aktivitas->links('pagination::bootstrap-5') }}
{{ $aktivitas->links('pagination::simple-bootstrap-5') }}
</div>
</div>
</div>