@extends('components.app-layout') @section('title', 'Activity Log Details') @section('subtitle', 'Detailed view of security log entry') @section('content')

Activity Log Details

Log ID: #{{ $log->id }}

@if($log->severity === 'critical') @elseif($log->severity === 'high') @elseif($log->severity === 'medium') @else @endif

{{ ucfirst(str_replace('_', ' ', $log->action)) }}

{{ $log->created_at->format('M j, Y \a\t g:i A') }}

{{ ucfirst($log->severity) }} Priority

User Information

@if($log->user)
{{ $log->user->name }}
{{ $log->user->email }}
Role: {{ ucfirst($log->user->role ?? 'User') }}
@else
System or Anonymous User
@if($log->user_type)
User Type: {{ $log->user_type }}
@endif @endif

Action Details

Action:
{{ ucfirst(str_replace('_', ' ', $log->action)) }}
Severity:
{{ ucfirst($log->severity) }}
@if($log->model_type && $log->model_id)
Affected Resource:
{{ class_basename($log->model_type) }} #{{ $log->model_id }}
@endif

Session & Network

@if($log->ip_address)
IP Address:
{{ $log->ip_address }}
@endif @if($log->session_id)
Session ID:
{{ $log->session_id }}
@endif @if($log->user_agent)
User Agent:
{{ $log->user_agent }}
@endif

Description

{{ $log->description }}

@if($log->properties && count($log->properties) > 0)

Additional Properties

{{ json_encode($log->properties, JSON_PRETTY_PRINT) }}
@endif

Timeline

Created: {{ $log->created_at->format('M j, Y \a\t g:i:s A') }}
Time Ago: {{ $log->created_at->diffForHumans() }}
Day of Week: {{ $log->created_at->format('l') }}
Log Entry #{{ $log->id }} • Created {{ $log->created_at->diffForHumans() }}
@if($log->severity === 'critical' || $log->severity === 'high') @endif
@if($log->user_id)

Recent Activity from Same User

@php $recentLogs = \App\Models\ActivityLog::where('user_id', $log->user_id) ->where('id', '!=', $log->id) ->orderBy('created_at', 'desc') ->limit(5) ->get(); @endphp @if($recentLogs->count() > 0)
@foreach($recentLogs as $recentLog)
{{ ucfirst(str_replace('_', ' ', $recentLog->action)) }}
{{ $recentLog->created_at->diffForHumans() }}
View Details
@endforeach
@else

No other recent activity from this user

@endif
@endif
@endsection