When I define a route in the VerifyCsrfToken file, access to sanctum data disappears, and it returns null.
`
namespace AppHttpMiddleware;
use IlluminateFoundationHttpMiddlewareVerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array<int, string>
*/
protected $except = [
'/check-payment'
];
}`
auth('sanctum')->user()
I have a payment link, and when the user logs in, they go to the gateway. After completing the payment, a POST request is sent to me, and I need the data of the logged-in user.
carcosa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.