@php $isOnline = false; if($user->last_login) { try { $isOnline = \Carbon\Carbon::parse($user->last_login)->diffInMinutes(now()) < 10; } catch (\Exception $e) { $isOnline = false; } } @endphp @php $smartScore = isset($user->smart_score) ? (float) $user->smart_score : null; $scoreLabel = ''; $scoreClass = ''; if ($smartScore !== null) { if ($smartScore >= 75) { $scoreLabel = 'توافق ممتاز'; $scoreClass = 'score-excellent'; } elseif ($smartScore >= 50) { $scoreLabel = 'توافق جيد'; $scoreClass = 'score-good'; } else { $scoreLabel = 'توافق مقبول'; $scoreClass = 'score-fair'; } } @endphp