@php // Cast — status is a tinyint, and an uncast one can arrive as a string, // which would slip past the strict comparisons below. $currentStatus = (int) ($offer->status ?? \App\Models\Offer::STATUS_PENDING); $statusClasses = [ \App\Models\Offer::STATUS_PENDING => 'pending', \App\Models\Offer::STATUS_APPROVED => 'approved', \App\Models\Offer::STATUS_REJECTED => 'rejected', ]; $currentClass = $statusClasses[$currentStatus] ?? 'pending'; $currentLabel = \App\Models\Offer::STATUS_LABELS[$currentStatus] ?? 'Pending'; // An approve/reject decision is final, so only a pending offer gets a // working dropdown. OfferController::updateStatus enforces the same rule. $isLocked = $currentStatus !== \App\Models\Offer::STATUS_PENDING; @endphp @if ($isLocked)