Closed fstrazzante closed 6 months ago
1.8.1
10.8
When I try to check the current route with nested params, I got false but it should be true.
route: example.com/dashboard?filter[year]=2024 (I use spatie/laravel-query-builder)
on the page loaded on this route I did some tests:
console.log("current params", route().params) console.log("current route", route().current('dashboard')) console.log("{ filter: { year: 2024 } }", route().current('dashboard', { filter: { year: 2024 } })) console.log("{ filter: { year: '2024' } }", route().current('dashboard', { filter: { year: '2024' } })) console.log("{ 'filter[year]': '2024' }", route().current('dashboard', { 'filter[year]': '2024' }))
And this is the result:
Calling route().current('dashboard', { filter: { year: '2024' } } on route example.com/dashboard?filter[year]=2024 I expected to have true
route().current('dashboard', { filter: { year: '2024' } }
example.com/dashboard?filter[year]=2024
true
No error registered
{ "uri": "dashboard", "methods": [ "GET", "HEAD" ] }
Route::get('dashboard', [DashboardController::class, 'index'])->name('dashboard');
Ziggy version
1.8.1
Laravel version
10.8
Description
When I try to check the current route with nested params, I got false but it should be true.
route: example.com/dashboard?filter[year]=2024 (I use spatie/laravel-query-builder)
on the page loaded on this route I did some tests:
And this is the result:
Calling
route().current('dashboard', { filter: { year: '2024' } }
on routeexample.com/dashboard?filter[year]=2024
I expected to havetrue
Ziggy call and context
Ziggy configuration
Route definition