{{-- Requires an iframe as video variable, from ACF --}} @php // Use preg_match to find iframe src. preg_match('/src="(.+?)"/', $video, $matches); $src = $matches[1]; $marginTop = $marginTop ?? false; // Add extra parameters to src and replcae HTML. $params = array( 'rel' => 0, ); $new_src = add_query_arg($params, $src); $video = str_replace($src, $new_src, $video); // Add extra attributes to iframe HTML. $video = str_replace('>', ' ' . $attributes . '>', $video); @endphp
{!! $video !!}