Closed matoh closed 6 years ago
The use case isn't supported, a route parameter is a separate segment of the URI /{fromCountryCode}/{toCountryCode}
.
Having two named parameters in one segment won't work at the moment.
Ok thank you for your answer but the output is the same when i tried to do the examples mentioned above with 2 segments for country codes - /{fromCountryCode}/{toCountryCode}
.
Is it allowed to pass multiple parameters(named parameters for route and parameters that will be converted to query string) to route helper function?
I found examples of doing it in Laracast discussions and i am not sure if it is the right way to go as this functionality of route helper function is not documented.
Thanks
Description:
When generating URL for a given named route with parameters using route() helper function, it happens that URL could be generated with different structure depending on parameters order.
In the documentation, there is no mention of functionality allowing passing parameters that are not defined as route parameters. So i am not sure if these parameters should be automatically added to the URL as query string parameters or not. In case that this behavior of adding query string parameters is expected then generating of URL should be consistent for the defined route parameters.
Steps To Reproduce:
Create new routes and test following examples.
Enter URL address of the route definition bellow: {baseUrl}/test1/SK-GB
Outputs:
Enter URL address of the route definition bellow: {baseUrl}/test2/SK-GB
Outputs
When route parameter value toCountryCode is empty string instead of null, both URL addresses will be generated with the same structure.