Send a good response with parameters to identify
return response()->json([
'status' => true,
'message' => 'Registered Successfully',
'response_logs' => $error_logs_list
]);
In the above response, you can make conditional things on 'status'
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I cant help but notice that all guides I have come across on how to authenticate APIs using Sanctum, skip the user registration bit. Often users will be seeded or registered using the web flow and then the pre-existing users will be used to demonstrate the token and session capabilities of sanctum.
This presents an interesting challenge. Given that Sanctum automatically logs you in when you hit the register endpoint that it exposes, I cant send a second registration request to the endpoint since the guard will try to navigate me to a home page, which is simply not ideal for APIs.
How then do I go about, either or
@kisiara Sanctum doesn’t have a registration endpoint? It’s literally a package for issuing tokens or doing stateful cookie authentication for SPAs. It doesn’t deal with anything else like registration or password resetting.
Please or to participate in this conversation.