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

Optional URL Parameter Compatibility #113

Open
siddiqar opened this issue Dec 2, 2024 · 1 comment
Open

Optional URL Parameter Compatibility #113

siddiqar opened this issue Dec 2, 2024 · 1 comment

Comments

@siddiqar
Copy link

siddiqar commented Dec 2, 2024

Laravel provides optional parameters in routes by appending a " ? " at the end of the parameter name. However, the generated collection does not account for this, resulting in parameters like example.test/{param?}. Ideally, these should still be converted into URL parameters, with optionality preserved or handled appropriately.

image

For example:

Route definition: example.test/{param?}
Expected conversion: example.test/:param (with recognition of the parameter being optional)
This behavior needs to be addressed to ensure compatibility with Laravel's route syntax and proper handling of optional parameters in the generated output.
image

@tomirons
Copy link
Collaborator

tomirons commented Dec 5, 2024

@siddiqar can you please provide an example route definition that will help us replicate what you're seeing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants