Summer Sale! All accounts are 50% off this week.

Jesmaybe's avatar

Laravel blade external url link reading url from database

I am getting url's from my database and trying to create links to them with blade.

I have this;

   @foreach($videos as $video)
       <li><a href="{{ url($video->url) }}"> {{ $video->name }} </a></li>
   @endforeach 

which is generating links to (for example if the video url is www.google.com) http://localhost:8000/www.google.com

I cannot figure out how to remove the http://localhost:8000/ and generate a link to the database url without the web root

Thanks

0 likes
4 replies
topvillas's avatar
Level 46

Try prepending http:// to the URL.

It looks to be a problem with local and absolute URLs

2 likes

Please or to participate in this conversation.