@extends('layouts.admin') @section('title', 'Certificate: ' . $certificate->validation_code) @section('page-title', 'Certificate Details') @section('content')
Back to Certificates {{-- Status Banner --}} @if($certificate->isRevoked())

Certificate Revoked

By {{ $certificate->revokedBy?->name ?? 'System' }} on {{ $certificate->revoked_at->format('d M Y H:i') }}

@if($certificate->revocation_reason)

Reason: {{ $certificate->revocation_reason }}

@endif
@else

Active Certificate

@endif

Certificate Information

Validation Code
{{ $certificate->validation_code }}
Client
{{ $certificate->document->user->name }}
Document Type
{{ $certificate->document->documentType->name }}
Issued At
{{ $certificate->issued_at->format('d M Y H:i') }}
Auth. File Hash
{{ $certificate->authenticated_hash }}
Total Verifications
{{ $certificate->verificationLogs->count() }}
{{-- Revoke --}} @if(!$certificate->isRevoked())

Revoke Certificate

Revoking is permanent. The public verification page will display REVOKED. The historical record is preserved.

@csrf
@error('revocation_reason')

{{ $message }}

@enderror
@endif {{-- Recent Verifications --}} @if($certificate->verificationLogs->isNotEmpty())

Recent Verification Attempts

@foreach($certificate->verificationLogs->take(10) as $log) @endforeach
Result Method IP Date
@php $rc=match($log->verification_result){'valid','hash_match','authenticated_match','original_match'=>'badge-success','revoked'=>'badge-secondary',default=>'badge-danger'}; @endphp {{ ucfirst(str_replace('_',' ',$log->verification_result)) }} {{ ucfirst(str_replace('_',' ',$log->verification_method)) }} {{ $log->ip_address }} {{ $log->verified_at->format('d M Y H:i') }}
@endif
@endsection