A dockerized Laravel REST API starter :
- Laravel 12
- Sanctum Session and Token based Auth
- Email verification
- Telescope
- Postman Setting
- Feature tests
- Install docker
- Clone the repo
- Install application
./lvl install - Launch the API
./lvl start
Import Postman's setup files from ./.postman to test the api auth endpoints.
- Enter the container:
docker compose exec api sh - Run tests:
php artisan tests - Create a new Resource:
php artisan make:api-resource <name> - Telescope:
http://localhost:8000/telescope
You can generate a new resource with the artisan command:
./lvl artisan make:api-resource {resource_name}It will generate the following files:
- Model
- Migration
- Seeder
- Controller
- Requests
- Resource
- Routes
- Tests
You can also ask cursor to generate everything for you, just ask for a new resource with the details of its attributes and relationship and it will generate everything for you using the rule in ./.cursor/rules/generate-api-resource.mdc:
The project includes a convenient command-line tool lvl for managing the Docker environment:
# Run Artisan commands
./lvl artisan <command>
# Manage containers
./lvl start
./lvl stop
./lvl restart
./lvl down # with -v to destroy volumes
# Development tools
./lvl composer <command>
./lvl test
./lvl pint
./lvl stan
# Docker management
./lvl build [image]
./lvl logs [container]
./lvl exec [command]
# Project management
./lvl install
./lvl update
./lvl destroyFor a complete list of commands and options, run ./lvl without arguments.