@props(['video'])
@auth @if (Auth::id() === $video->user_id) @elseif (Auth::id() !== $video->user_id) @php $isSubscribed = Auth::user()->isSubscribedTo($video->user); @endphp @endif @else @endauth @auth @else @endauth @if ($video->isShareable()) @endif @php $dlAccess = $video->download_access ?? 'disabled'; $dlUser = Auth::user(); $showDl = match($dlAccess) { 'everyone' => true, 'registered' => (bool) $dlUser, 'subscribers' => $dlUser && ($dlUser->id === $video->user_id || $dlUser->isSubscribedTo($video->user)), default => false, }; @endphp @if($showDl) @php $isAudioDl = $video->isAudioOnly(); @endphp @endif