Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove not substituted arguments #133

Closed
g-rodigy opened this issue Sep 4, 2023 · 1 comment
Closed

Remove not substituted arguments #133

g-rodigy opened this issue Sep 4, 2023 · 1 comment
Labels
status:ready for adoption Feel free to implement this issue.

Comments

@g-rodigy
Copy link

g-rodigy commented Sep 4, 2023

Proposal to not add not substituted arguments if they a not in route. I think this not need here, in UrlGenerator::generate() has the separate argument for query string. If it ok, I can make PR.

return $path . (
$notSubstitutedArguments !== [] || $queryParameters !== [] ?
'?' . http_build_query(array_merge($notSubstitutedArguments, $queryParameters))
: ''

What steps will reproduce the problem?

// routes
Route::get('/view/{mode}')->name('view');
$urlGenerator->setDefaultParameter('mode', 'simple');
$urlGenerator->setDefaultParameter('type', 'any');

$urlGenerator->generate('view');

What is the expected result?

/view/simple

What do you get instead?

/view/simple?type=any

Additional info

Q A
Version 3.0.0
PHP version 8.0
Operating system
@samdark
Copy link
Member

samdark commented Oct 19, 2023

Please do. It makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue.
Projects
None yet
Development

No branches or pull requests

2 participants