You can use sanctum to work with laravel https://laravel.com/docs/8.x/sanctum#introduction
https://laravel.com/docs/8.x/sanctum#api-token-authentication
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
So I use the Laravel/ui package for register and login with 2 applications. I have a Laravel application and a C# application. The C# application use the API of the laravel application to register, login and get some data.
I tested the api request with Postman and I got this error: "Session store not set on request." So the error is showing because the first line in the method sendLoginResponse() wants to regenerate the session that isn't stored in the request. But I don't need or use the session on my c# application, so does anyone have an idea or advice to solve this error?
(api.php)
Route::post('/login', [LoginController::class, 'login']);
(AuthenticatesUsers.php from Laravel/ui)
protected function sendLoginResponse(Request $request)
{
$request->session()->regenerate();
$this->clearLoginAttempts($request);
if ($response = $this->authenticated($request, $this->guard()->user())) {
return $response;
}
return $request->wantsJson()
? new JsonResponse([], 204)
: redirect()->intended($this->redirectPath());
}
Please or to participate in this conversation.