This is an example of a REST API using auth tokens with Laravel Sanctum
Change the .env.example to .env and add your database info
For Mysql, add
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=rest-api
DB_USERNAME=root
DB_PASSWORD=123456
# Public
GET /api/products
GET /api/products/:id
POST /api/login
@body: email, password
POST /api/register
@body: name, email, password, password_confirmation
# Protected
POST /api/products
@body: name, slug, description, price
PUT /api/products/:id
@body: ?name, ?slug, ?description, ?price
DELETE /api/products/:id
POST /api/logout