@php
// statut label from DB (trans_field) or fallback to the statut's arabic label or a generic label
$statutLabel = trans_field($document->statut, 'statut')
?? $document->statut?->statut_ar
?? __('site.formation.status.pending');
@endphp
وضعية الطلب
{{ $statutLabel }}
@php
// choose the document-specific comment based on current status
$docComment = null;
if ($document->id_statut == 3) {
$docComment = $document->commentaire_motif;
} elseif ($document->id_statut == 4) {
$docComment = $document->commentaire_acceptation;
} elseif ($document->id_statut == 5) {
$docComment = $document->commentaire_avis;
}
// prefer document comment; otherwise fallback to relevant history comment (if any)
$currentComment = !empty($docComment) ? $docComment : ($relevantHistory->commentaire ?? null);
// detect if the displayed comment came from history (so we can show metadata)
$commentFromHistory = empty($docComment) && isset($relevantHistory) && !empty($relevantHistory->commentaire);
$historyAuthor = $relevantHistory->changer->name ?? $relevantHistory->changed_by ?? null;
$historyAt = isset($relevantHistory->created_at) ? $relevantHistory->created_at->format('Y-m-d H:i') : null;
@endphp
@if(!empty($currentComment))
{{ __('site.start_activity.current_comment') }}
{{ $currentComment }}
@endif
{{-- IDENTITÉ DU PORTEUR --}}
الاسم
{{ $document->utilisateur->nom_prenom ?? '-' }}
الهاتف
{{ $document->utilisateur->tel ?? '-' }}
البريد الإلكتروني
{{ $document->utilisateur->email ?? '-' }}
{{-- INFORMATIONS PROJET --}}