@extends('layouts.app',['ver' => 2]) @section('content')

{!!$masterclass->titre!!}

Intervenant: {!!$masterclass->presentateur->nom!!} {!!$masterclass->presentateur->prenom!!}

{!!$masterclass->description !!}

@php $currentvideo = $videotoplay ?? null; if (!$currentvideo && $masterclass->videos->count() > 0) { if (auth()->check() && optional(auth()->user()->subscription)->onTrial()) { $currentvideo = $masterclass->videos->where('available_ontrial', 1)->first(); } else { $currentvideo = $masterclass->videos->first(); } } // Extract YouTube Video ID from the full URL function getYoutubeId($url) { preg_match('/(?:\/|v=|youtu\.be\/|embed\/)([a-zA-Z0-9_-]{11})/', $url, $matches); return $matches[1] ?? null; } $videoId = $currentvideo ? getYoutubeId($currentvideo->lien) : null; @endphp @if($currentvideo)
@if(auth()->check() && auth()->user()->hasActiveSubscription())
@else
@if(auth()->check())

Vous devez vous abonner pour regarder.

S'abonner @else

Connectez-vous et abonnez-vous pour regarder

Se connecter S'abonner @endif
@endif

{{ $currentvideo->titre }}

{{ $currentvideo->description }}

@endif
@foreach($masterclass->videos as $video) @php // Extract YouTube Video ID from the full URL preg_match('/(?:\/|v=)([a-zA-Z0-9_-]{11})/', $video->lien, $matches); $cvideoId = $matches[1] ?? null; @endphp
Video Thumbnail
{{ $video->titre }}

{{ $video->description }}

@if(auth()->check() && auth()->user()->hasActiveSubscription()) @elseif(auth()->check()) @endif
@endforeach
@if(!auth()->check() || !auth()->user()->hasActiveSubscription())
Vous devez être abonné pour regarder ces vidéos.
S'abonner
@endif
@push('scripts') @endpush @endsection