@extends('admin.layout.master') @section('open-executive', 'open') @section('menu-executive', 'bg-gradient-to-r from-[#53BF6A] to-[#275931] text-white') @section('menu-history-activity', 'bg-gradient-to-r from-[#53BF6A] to-[#275931] text-white') @section('content') {{-- Breadcrumb --}}
Executive Team › Riwayat Aktivitas › Detail #{{ $activity->id }}
{{-- Header Card --}}
{{-- Event Badge --}} @php $eventColors = [ 'created' => 'bg-green-500', 'updated' => 'bg-blue-500', 'deleted' => 'bg-red-500', ]; $eventColor = $eventColors[$activity->event ?? ''] ?? 'bg-gray-500'; @endphp {{ strtoupper($activity->event ?? 'UNKNOWN') }} Detail Aktivitas
Kembali
{{-- Info Utama --}}
{{-- Pengguna --}}
Pengguna @if ($activity->causer)
{{ strtoupper(substr($activity->causer->name, 0, 1)) }}
{{ $activity->causer->name }}
{{ $activity->causer->email }}
@else Sistem / Tidak diketahui @endif
{{-- Model --}}
Model
{{ class_basename($activity->subject_type ?? '-') }} (ID: {{ $activity->subject_id ?? '-' }})
@if ($activity->subject_type)
{{ $activity->subject_type }}
@endif
{{-- Deskripsi --}}
Deskripsi {{ $activity->description ?? '-' }}
{{-- Waktu --}}
Waktu {{ $activity->created_at->format('d M Y, H:i:s') }} {{ $activity->created_at->diffForHumans() }}
{{-- Log Name --}}
Log Name {{ $activity->log_name ?? '-' }}
{{-- Properties --}} @php $changesRaw = $activity->attribute_changes; $changesArr = is_string($changesRaw) ? json_decode($changesRaw, true) : (is_array($changesRaw) ? $changesRaw : (is_object($changesRaw) && method_exists($changesRaw, 'toArray') ? $changesRaw->toArray() : (array) $changesRaw)); if (empty($changesArr) && $activity->properties) { $changesArr = is_string($activity->properties) ? json_decode($activity->properties, true) : (is_object($activity->properties) && method_exists($activity->properties, 'toArray') ? $activity->properties->toArray() : (array) $activity->properties); } @endphp @if (!empty($changesArr))

Perubahan Data

{{-- Perubahan Data (Combined) --}} @php $oldData = $changesArr['old'] ?? []; if (!is_array($oldData)) $oldData = []; $newData = $changesArr['attributes'] ?? $changesArr['new'] ?? []; if (!is_array($newData)) $newData = []; $allKeys = collect(array_keys($oldData))->merge(array_keys($newData))->unique()->values(); @endphp @if ($allKeys->isNotEmpty())

Detail Perubahan

@foreach ($allKeys as $key) {{-- Nilai Sebelum --}} {{-- Nilai Sesudah --}} @endforeach
Field Nilai Sebelum Nilai Sesudah
{{ $key }} @if (!array_key_exists($key, $oldData)) - @elseif (is_null($oldData[$key])) null @elseif (is_array($oldData[$key]))
{{ json_encode($oldData[$key], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}
@else {{ $oldData[$key] }} @endif
@if (!array_key_exists($key, $newData)) - @elseif (is_null($newData[$key])) null @elseif (is_array($newData[$key]))
{{ json_encode($newData[$key], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}
@else {{ $newData[$key] }} @endif
@endif {{-- Raw Properties jika tidak ada old/attributes --}} @if (empty($oldData) && empty($newData))

Properties

{{ json_encode($changesArr, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}
@endif
@else
Tidak ada detail perubahan data untuk aktivitas ini.
@endif
@endsection