@extends('layouts.app') @section('title', $document->title . ' · ' . config('app.name')) @section('page-title', 'Document Details') @section('content')

{{ $document->title }}

{{ $document->department->name }}
@if($document->status === 'completed') Download Final Document @endif Download Original @can('update', $document) Edit Details @if($document->original_file_extension === 'docx') Edit Document @endif @endcan
Description

{{ $document->description ?: 'No description provided.' }}

@if($document->tags->isNotEmpty())
@foreach($document->tags as $tag) #{{ $tag->name }} @endforeach
@endif
{{-- Workflow Actions --}}
Workflow Actions
@can('update', $document) @if($document->status === 'draft')
@csrf
@endif @endcan @can('approve', $document) @if($document->status === 'under_review') @endif @if($document->status === 'rejected') @endif @endcan @if($document->status === 'completed') No further actions — document is completed. @endif
@can('approve', $document)
@include('documents.partials.workflow-form', ['action' => 'approve', 'label' => 'Confirm Approval', 'style' => 'success', 'icon' => 'bi-check-circle'])
@include('documents.partials.workflow-form', ['action' => 'reject', 'label' => 'Confirm Rejection', 'style' => 'danger', 'icon' => 'bi-x-circle'])
@include('documents.partials.workflow-form', ['action' => 'request-changes', 'label' => 'Send for Changes', 'style' => 'warning', 'icon' => 'bi-arrow-repeat'])
@include('documents.partials.workflow-form', ['action' => 'send-back', 'label' => 'Send Back to Draft', 'style' => 'secondary', 'icon' => 'bi-arrow-left-circle'])
@endcan
{{-- Remarks / Discussion --}}
Remarks
    @forelse($document->remarks as $remark)
  • {{ $remark->user->name }} {{ $remark->created_at->format('d M Y, h:i A') }}
    {{ $remark->user->department?->name }} · {{ $remark->user->rank?->name }}

    {{ $remark->body }}

  • @empty
  • No remarks yet.
  • @endforelse
@can('addRemark', $document)
@csrf @error('body')
{{ $message }}
@enderror
@endcan
Assigned Staff
    @foreach($document->assignees as $assignee)
  • {{ $assignee->name }}
    {{ $assignee->designation?->name }}
  • @endforeach
Version History
    @foreach($document->versions as $version)
  • Version {{ $version->version_number }} @if($document->status === 'completed' && $version->version_number === $document->latestVersion()->version_number) Final @endif
    @if(! $version->is_original && strtolower(pathinfo($version->file_path, PATHINFO_EXTENSION)) === 'docx') View Changes @endif Download
    {{ $version->editor->name }} · {{ $version->created_at->format('d M Y, h:i A') }}
    @if($version->remarks)
    {{ $version->remarks }}
    @endif
  • @endforeach
@can('update', $document)
@csrf @error('file')
{{ $message }}
@enderror
@endcan
Workflow History
    @forelse($document->workflowLogs as $log)
  • {{ $log->user->name }} {{ str_replace('_', ' ', $log->action) }} ({{ ucwords(str_replace('_', ' ', $log->from_status)) }} → {{ ucwords(str_replace('_', ' ', $log->to_status)) }})
    {{ $log->created_at->format('d M Y, h:i A') }}
    @if($log->remarks)
    "{{ $log->remarks }}"
    @endif
  • @empty
  • No workflow activity yet.
  • @endforelse
@php $shouldGenerateThumbnail = in_array($document->original_file_extension, ['pdf', 'docx'], true) && (! $document->thumbnail_path || session('regenerate_thumbnail')); @endphp @endsection @push('scripts') @vite(['resources/js/document-thumbnail.js']) @endpush