I also confirmed this by updating the feature parity test and appending a query parameter.
test('feature parity', function () {
Route::get('/posts/{lowerCase}/{UpperCase}/{podcast}/{user:email}/show', function (
string $id,
string $upperCase,
Podcast $podcast,
User $user) {
//
})->name('users.regular');
$parameters = [
'lowerCase' => 'lowerCaseValue',
'upperCase' => 'UpperCaseValue',
'podcast' => Podcast::first(),
'user' => User::first(),
'query' => 'string',
];
$expectedRoute = '/posts/lowerCaseValue/UpperCaseValue/1/[email protected]/show?query=string';
$route = route('users.regular', [
'lowerCase' => 'lowerCaseValue',
'UpperCase' => 'UpperCaseValue',
'podcast' => Podcast::first(),
'user' => User::first(),
'query' => 'string',
], false);
expect($route)->toBe($expectedRoute);
$route = route('posts.show', $parameters, false);
expect($route)->toBe($expectedRoute);
});
This fails the expectation for Folio's named routes, but not for the native named routes:
FAILED Tests\Feature\NameTest > feature parity
Failed asserting that two strings are identical.
-'/posts/lowerCaseValue/UpperCaseValue/1/[email protected]/show?query=string'
+'/posts/lowerCaseValue/UpperCaseValue/1/[email protected]/show'
at tests/Feature/NameTest.php:103
99โ expect($route)->toBe($expectedRoute);
100โ
101โ $route = route('posts.show', $parameters, false);
102โ
โ 103โ expect($route)->toBe($expectedRoute);
104โ });
105โ
106โ test('model route binding wrong column', function () {
107โ $parameters = [
1 tests/Feature/NameTest.php:103
Tests: 1 failed (2 assertions)
Duration: 0.08s
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
.