Level 104
You do not define the expected querry string in the Route definition. You get the query params from the Request object:
Route::get('invitation', function () {
dump(request()->all()); // ['token' => 'test']
});
2 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
When I add this route to web.php
route::get('invitation?token=test', function () { return 'test'; });
I get a 404 when visiting the page .../invitation?token=test
What am i doing wrong?
You do not define the expected querry string in the Route definition. You get the query params from the Request object:
Route::get('invitation', function () {
dump(request()->all()); // ['token' => 'test']
});
Please or to participate in this conversation.