@extends('layouts.app') @section('title', 'Лог действий') @section('content')
| Дата/Время | Пользователь | Действие | Объект | Название | Изменения |
|---|---|---|---|---|---|
| {{ $log->created_at->format('d.m.Y H:i:s') }} | {{ $log->user_name }} | @if($log->action === 'created') Создан @elseif($log->action === 'updated') Изменен @elseif($log->action === 'deleted') Удален @endif | {{ class_basename($log->model_type) }} | {{ Str::limit($log->model_name, 50) }} |
@if($log->changes)
@php $changes = is_array($log->changes) ? $log->changes : json_decode($log->changes, true); @endphp
@if($changes)
@foreach($changes as $field => $value)
{{ $field }}:
@if(is_array($value))
{{ $value['old'] ?? '...' }} → {{ $value['new'] ?? '...' }}
@else
→ {{ $value }}
@endif
@endforeach @endif @endif |