Need help with API for React app to register User with Laravel 8, Jetstream and Sanctum
Hi all,
I'm trying to get my head around how I would set up an API endpoint to register new users in my SPA which is built in React. To get started I'm using Postman though.
I'm not an experienced Laravel developer so forgive me for maybe being a bit behind the times here - however I've realised that Laravel 8 now uses Jetstream and Santum, so I've set up a new project with these and I've enabled api support inside /config/jetstream.php. I figure that this is the new way of doing things so I'd give it a try!
I've also set up an API token called SPA by registering a new user on my dashboard with all the permissions, although I'm not entirely sure this is/was necessary??
I'm confused becasuse there is no AuthController and I'm not sure if I need to set up my user registration routes in web.php or api.php - or do they already exist? Documentation for this seems unfinished to be honest. All I really want to begin with is an endpoint /api/register where I just send a name, email and password and it returns a response. Ideally I want to use the email confirmation as well - but one step at a time!!!
Thank you very much @sinnbeck - I will check out Breeze and Inertiajs, there's just so many different options and of course Laravel 8 changing the way it does things adds more!
I did have a look at this article - https://therichpost.com/reactjs-laravel-8-user-auth-registration-working-example/ - as it's simply an endpoint to register a user, there's no token checking or anything like that, it would be fairly straightforward to customise that to my needs I guess - would the AuthController from that work?
Lets say I wanted to get my registrants to confirm by email before activating their account - where abouts would that logic go and what would it look like?