Answer the question
In order to leave comments, you need to log in
Laravel route name function over https, how to do in view?
In the form, in the view, I display the router on the post link:
<form method="POST" action="{{route('additem', ['id' => $loc->id])}}">
http://site.com/catalog/id/additem
https://site.com/catalog/id/additem
APP_URL=https://site.com
Worth as needed. Route::post('catalog/{id}/additem', '[email protected]')->name('additem')->where('id', '[0-9]+');
Answer the question
In order to leave comments, you need to log in
There are a lot of crutches in the network and for some reason no one writes about the third parameter in the route function In the function, the 3rd parameter by default is true , which says to take into account the root url. In this case, to create a url in the form, you need to add false to the third parameters. As a result, the url with the default protocol of the page is displayed in the view.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question