Link in laravel blade template
22,219
Use the Laravel helper url()
For a link to the home page: <a href="{{ url('/') }}">Visit Google</a>
From Laravel docs: https://laravel.com/docs/5.5/helpers#method-url
Author by
Vojta
Updated on July 09, 2022Comments
-
Vojta almost 2 years
I'm struggling to create link in blade template in Laravel. I will pass the URL in template from environment variable.
The output suppose to be like.
<a href="https://google.com">Visit Google</a>
I am trying sth like this but with no luck.
<a href="{{env('APP_URL')}}">Visit my site</a>
Laravel Framework 5.5.19
Thank you