Closed cod3rshotout closed 1 year ago
Hi,
This wasn't possible yet, but I've just added an option to exclude the query string:
Route::localizedUrl($locale = null, $parameters = null, $absolute = true, $keepQuery = true);
I'll tag it in a sec.
@ivanvermeyen thanks for the update but I still have the parameters .. seems the following line should be updated:
if ($url = $this->generateFromNamedRoute($locale, $parameters, $absolute)) {
dd($url);
return empty($query) && $keepQuery ? $url . $urlBuilder->getQueryString() : $url;
}
Essentially $url
contains this: https://example.com/it/form-and-function?_config%5Bview%5D=shop%3A%3Alayouts.pages.form-and-function
. But should contains only: https://example.com/it/form-and-function
, so even specifying keepQuery
on true, the parameters are still there.
Did you set $keepQuery
to false
to not show the query?
If true
it will show the query. (which is the default)
@ivanvermeyen yes, I set it, but as I said generateFromNamedRoute
return the url with the query string, so even though $keepQuery
is false, I get the parameters. Guess the same parameter should be passed to generateFromNamedRoute
Query parameters passed to the function (or defaults in your case) were not removed. Should be fixed now in 2.10.1 👍
Hi, thanks for your library first of all!
I'm having a problem using
Route::localizedUrl
, in particular, some routes are defined in this way:so calling
localizedUrl
will return:is there any way to remove all the parameters from the url and keep only
https://example.com/it/form-and-function
Thanks