Hi, I’m trying to echo out a source using {{ $video }} but the link missing the http/(s) protocol.
Tried {!! $video !!} as well but no luck … If I do var_dump($video) from the controller i can see the protocol there, so my thought is that blade are doing something with the source before it’s echo.
Can we take a look at var_dump( $amp_data ) or print_r( $amp_data ) to confirm the scheme is actually in the data in the database?
The good news is that the scheme isn’t technically necessary. Scheme-relative URLs are actually valid and browser will re-use whatever the current scheme is in the browser bar. But it’s irritating to have data removed from fields.
{{ }} just runs the string through PHP’s htmlentities. Unless you need to escape html for security reasons and want output that looks like <b>& this</b> instead of & this, use {!! !!} instead.
I’ve never seen the Controller strip the scheme. In this case I’d take a look at ACF and experiment with running get_sub_field('amp_modules_video_mp4')['url'] outside of Controller and Blade to see what’s returned.