The focus of boilerplate is on developing headless API applications.
- The official "Laravel Sail" wrapper over docker with PHP version 8.2 was chosen as the development environment
- Configured code style fixer "Laravel Pint"
composer pint
- Configured static analyser "PHPStan"
composer phpstan
- Configured the configuration and custom stubs for the module generator "Laravel Modules"
- Configured eloquent strictness
- CarbonImmutable used by default instead Carbon
- "Laravel Pint" configuration requires final classes (final_class) and strict types (declare_strict_types)
- Convert responses to JsonResponse via ConvertResponsesToJSON middleware
- Configured basic authentication for Horizon using
HORIZON_USERNAME
andHORIZON_PASSWORD
credentials at .env - Configured basic authentication for Telescope using
TELESCOPE_USERNAME
andTELESCOPE_PASSWORD
credentials at .env
- Copy the base application configuration:
cp .env.example .env
- Installing composer dependencies for existing application:
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php83-composer:latest \
composer install --ignore-platform-reqs
- Launch application:
./vendor/bin/sail up -d
- Generate application key:
php artisan key:generate
- Running migrations:
php artisan migrate
- Running seeders:
php artisan db:seed
- Run code static analyser & style fixer (PHPStan & Pint):
composer analyse
- laravel/pint (Code style fixing)
- laravel/horizon (Redis queues monitoring dashboard)
- laravel/telescope (Application requests monitoring dashboard)
- nwidart/laravel-modules (Modular project structure)
- spatie/laravel-data (Transformation of output data)
- spatie/laravel-fractal (Data transfer object)
- roave/security-advisories (Packages security vulnerabilities)
- nunomaduro/larastan (Static analysis)
- archtechx/enums (Extending default PHP enums via traits)
- Since the boilerplate focuses on the headless API of the application, the following changes were made to the framework:
- Removed web.php routes file from routes folder
- Removed web route mapping from RouteServiceProvider
- Removed 'web' group from middlewareGroups in Kernel
- Changed stubs path in module generator configuration to custom stubs/api