I use Laravel sanctum SPA specifically through sessions and cookies when logging out the user_id
field in Database is not set to null after the user logs out, but it remains until another request comes with the same sessions and then it becomes null
I use sessions in the database
I use Laravel API Routes
logout :
public function logout(Request $request)
{
Auth::guard('web')->logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
return ['msg' => "ok"];
}