@extends('layouts.app') @section('title', 'Activity Details - EDUC Pharmacy') @section('content')

Activity Details

Detailed information about this activity

Activity Information
Date & Time: {{ $activityLog->created_at->format('M d, Y H:i:s') }}
{{ $activityLog->time_ago }}
User: @if($activityLog->user)
{{ strtoupper(substr($activityLog->user->name, 0, 1)) }}
{{ $activityLog->user->name }}
{{ $activityLog->user->email }}
@else System @endif
Action: {{ ucfirst($activityLog->action) }}
Description: {{ $activityLog->description ?? '-' }}
Subject Type: {{ $activityLog->subject_type ? class_basename($activityLog->subject_type) : '-' }}
Subject ID: {{ $activityLog->subject_id ?? '-' }}
IP Address: {{ $activityLog->ip_address ?? '-' }}
User Agent: {{ $activityLog->user_agent ?? '-' }}
@if($activityLog->subject)
Subject Details
Subject: {{ class_basename($activityLog->subject_type) }} #{{ $activityLog->subject_id }}
@switch($activityLog->subject_type) @case('App\\Models\\Product')
Product Name: {{ $activityLog->subject->name ?? '-' }}
SKU: {{ $activityLog->subject->sku ?? '-' }}
Current Stock: {{ $activityLog->subject->current_stock ?? 0 }}
Purchase Price: MWK {{ number_format($activityLog->subject->purchase_price ?? 0, 2) }}
Selling Price: MWK {{ number_format($activityLog->subject->selling_price ?? 0, 2) }}
Category: {{ $activityLog->subject->category->name ?? '-' }}
@break @case('App\\Models\\Sale')
Invoice No: {{ $activityLog->subject->invoice_no ?? '-' }}
Customer: {{ $activityLog->subject->customer_name ?? '-' }}
Total Amount: MWK {{ number_format($activityLog->subject->total_amount ?? 0, 2) }}
Payment Method: {{ $activityLog->subject->payment_method ?? '-' }}
Payment Status: {{ $activityLog->subject->payment_status ?? '-' }}
Items Count: {{ $activityLog->subject->total_items ?? 0 }}
@break @case('App\\Models\\Purchase')
Reference No: {{ $activityLog->subject->reference_no ?? '-' }}
Supplier: {{ $activityLog->subject->supplier->name ?? '-' }}
Grand Total: MWK {{ number_format($activityLog->subject->grand_total ?? 0, 2) }}
Status: {{ $activityLog->subject->status ?? '-' }}
Payment Status: {{ $activityLog->subject->payment_status ?? '-' }}
Purchase Date: {{ $activityLog->subject->purchase_date?->format('M d, Y') ?? '-' }}
@break @default
Subject details are not available for this type of record.
@endswitch
@endif
Quick Actions
View All Activities @if($activityLog->subject) @switch($activityLog->subject_type) @case('App\\Models\\Product') Edit Product @break @case('App\\Models\\Sale') View Sale @break @case('App\\Models\\Purchase') View Purchase @break @endswitch @endif
@csrf @method('DELETE')
Related Activities
@if($activityLog->user)

Other activities by {{ $activityLog->user->name }}:

@php $relatedActivities = \App\Models\ActivityLog::where('user_id', $activityLog->user_id) ->where('id', '!=', $activityLog->id) ->latest() ->take(5) ->get(); @endphp @if($relatedActivities->count() > 0) @else

No other activities found.

@endif @else

No user information available.

@endif
@endsection