@extends('layouts.app') @section('title', $material->titol) @section('content')
@if($material->tipus === 'pdf')
@elseif($material->tipus === 'video')
@if(Str::contains($material->url, 'youtube')) @php preg_match('/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/', $material->url, $matches); $videoId = $matches[1] ?? null; @endphp @if($videoId) @endif @elseif(Str::contains($material->url, 'vimeo')) @php preg_match('/vimeo\.com\/(\d+)/', $material->url, $matches); $videoId = $matches[1] ?? null; @endphp @if($videoId) @endif @else @endif
@else

@switch($idioma) @case('es') Redirigiendo al enlace externo... @break @case('en') Redirecting to external link... @break @case('fr') Redirection vers le lien externe... @break @default Redirigint a l'enllac extern... @endswitch

{{ $material->url }}
@endif
@endsection