Search code examples
laravelurllocation-href

How can I escape the default router with a real url in laravel


In Blade view

<a class="media-left" href="{{$chunk->href}}">
                    <span class="glyphicon glyphicon-forward">Go</span>
</a>

{{$chunk->href}}=https://www.google.com

I got the error href url

localhost::8000/://https://www.google.com

use dd($chank) on the controller

enter image description here


Solution

  • The url() helper method is used to generate local-site urls. So if you want to insert the https://google.com link, do this:

    <a class="media-left" href="{{ $chunk->href }}">
        <span class="glyphicon glyphicon-forward">Go</span>
    </a>