Replies: 2 comments
-
I dug into this some more and it's actually not the case that Laravel automatically sorts params starting with Here's another example with more params: Route::get('/orders/{order}', [OrderController::class, 'index'])->name('order');
route('order', [123, 'first', '#anchor', 'third', 'param' => 'test']);
// https://domain.com/orders/123?param=test&first&#anchor&third String-indexed params, in this case What Route::get('orders/{order}#shipping', [OrderController::class, 'index'])->name('order-shipping');
route('order-shipping', [123, 'foo', 'param' => 'test']);
// https://domain.com/orders/123?param=test&foo#shipping I'm not sure there's actually anything Ziggy should do differently here. |
Beta Was this translation helpful? Give feedback.
-
In vue, I had to do this |
Beta Was this translation helpful? Give feedback.
-
Ziggy version
v1.4.6
Laravel version
v9.8.1
Description
Laravel's URL generator have separate algorithm for handling URL fragments (anchors?):
\Illuminate\Routing\RouteUrlGenerator::addQueryString
.Fragments are always appended to the end of query string and have no '=' after them.
Ziggy lacks that handy feature. That's the difference between Laravel and Ziggy generated URLs for the same route:
Laravel/Blade:
=>
https://domain.com/orders/123?param=test&#details
Ziggy:
=>
https://domain.com/orders/123?#details=¶m=test
Ziggy call and context
Ziggy configuration
Route definition
Beta Was this translation helpful? Give feedback.
All reactions