A simple Laravel API boilerplate equipped with Sanctum token based authentication.
To install the dependencies, navigate to the project's root directory and run:
composer install
Copy the contents of .env.example
to a .env
file, or simply run this command:
# Linux
cp .env.example .env
# Windows
copy .env.example .env
Configure the environment variables on the .env
file then generate the application key by running:
php artisan key:generate
To the run the migrations, execute the migrate
command:
php artisan migrate
Optionally, you can run the seeder to create test user data using this command:
php artisan db:seed
Method | Path | Description |
---|---|---|
POST | api/auth/register | Register a new account |
POST | api/auth/login | Login to an existing account |
GET | api/auth/user | Fetch the authenticated user |
Published documentation of the Postman collection can be found here. You can run the collection by clicking the โบ Run in Postman
button on the documentation page. The Development
environment must be set as the active environment.
Environment Variable | Description |
---|---|
server | Must be manually set with the application's URL |
token | Automatically set after a successful login |