I am testing Laravel Api and using Sanctum for token and i followed the documentation for sanctum but when i used the Route as
Route::middleware('auth:sanctum')->get('user', function () {
return User::all();
});
I am getting the message as
{
"message": "Unauthenticated."
}
in postman . Also , i am passing the token in Authetication in postman (Bearer token).