Answer the question
In order to leave comments, you need to log in
How to add domain to route() function?
Hello.
How can I add a domain to the route function with little bloodshed?
For example, I call it like this:
<a href="{{ route('page', $page->link) }}">{{ $page->h1_text }}</a>
<a href="/page.html">page</a>
<a href="https://site.com/page.html">page</a>
Answer the question
In order to leave comments, you need to log in
The
third parameter of route is (bool) absolute
By default, the route function generates an absolute URL. If you wish to generate a relative URL, you may pass false as the third argument:
$url = route('routeName', ['id' => 1], false);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question