Closed thinkverse closed 1 year ago
@nunomaduro this is the same request as https://github.com/laravel/folio/issues/81 I think
this is the same request as #81 I think
Don't think so, sounds like #81 wants to be able to pre-defined queries in the Folio file, maybe? IDK, query strings are already working in Folio, and Folio with Volt. They're accessible via request()
or $_GET
as always. Or with state()->url()
in Volt.
What I'm asking is to be able to generate a URL with route
and include query parameters in that. Figure a signup page with a referrer for instance:
route('register', ['referrer' => 'dries@laravel.com']);
// Currently with Folio named route:
// http://localhost/register
route('register', ['referrer' => 'dries@laravel.com']);
// Currently with a regular named route:
// http://localhost/register?referrer=dries%40laravel.com
Generating a URL with a named Folio route doesn't include the query parameter, as a regular named route would.
Fix in progress: https://github.com/laravel/folio/pull/88.
Currently, named routes don't support passing in query parameters to
route
, which doesn't provide 100% feature parity with native named routes. I noticed this while updating my test app tangerine to support named routes.I also confirmed this by updating the feature parity test and appending a query parameter.
This fails the expectation for Folio's named routes, but not for the native named routes:
This is used internally by Laravel, say password reset when generating the URL for the notification, which adds the users' email as a query parameter. Using a regular named route adds the query parameter, while Folio doesn't.
Would be great if Folio also supported adding query parameters when generating a URL with
route
.