This is a starter project for Laravel API authentication. It includes a user registration and login system.
There are tests for the registration and login.
- Clone the repository
- Run
composer install - Run
php artisan migrate - Run
php artisan serve
To register a user, send a POST request to /api/register with the following parameters:
nameemailpassword
To login a user, send a POST request to /api/login with the following parameters:
emailpassword
The response will include a token which you can use to authenticate future requests.
To logout a user, send a POST request to /api/logout include the token in the request headers.
After logging out, the token will no longer be valid.
To make an authenticated request, include the token in the request headers.
To run the tests, run php artisan test
This project is open-sourced software licensed under the MIT license.