@php
$userInfo = authCheck()?->userable ?? null;
$name = isset($userInfo?->first_name, $userInfo?->last_name)
? $userInfo?->first_name . ' ' . $userInfo?->last_name
: $userInfo?->name;
$imagePath = userImagePath(authCheck()->guard);
$storagePath = 'lms/' . $imagePath;
$defaultCoverImage = 'lms/frontend/assets/images/870x260.svg';
$defaultProfileImage = 'lms/assets/images/placeholder/profile.jpg';
// Determine the profile image
$coverImg =
!empty($userInfo?->cover_photo) && fileExists($storagePath, $userInfo->cover_photo)
? 'storage/' . $storagePath . '/' . $userInfo->cover_photo
: $defaultCoverImage;
$profileImg =
!empty($userInfo?->profile_img) && fileExists($storagePath, $userInfo->profile_img)
? 'storage/' . $storagePath . '/' . $userInfo->profile_img
: $defaultProfileImage;
@endphp