What url is it hitting? As its a get request it should be something like http://localhost/test?foo=bar
Also do this to check
dd($request->all());
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
I am trying to gather data from my API with NextJS getServerSideProps but the request I receive in the controller is null. So I cannot access the parameters I need.
Could someone help me on this please? Here is the route:
Route::get('/test', [TestController::class, 'test']);
Here is the controller:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class TestController extends Controller
{
public function test(Request $request) {
return ($request);
}
}
Thanks in advance.
@drannagg Yes. You dont pass any request params so it returns nothing.. As expected
Please or to participate in this conversation.