Tooling
Tooling enforces and accelerates the Laravel adapter. It does not redefine Core.
Module scaffolds
php artisan make:module {ModuleName}
php artisan make:module-model {ModuleName} {ModelName}
Scaffolds should generate Application / Domain / Infrastructure / UI, plus Ports/Acl and Ports/Module. They must not create a literal Feature/ directory — {Capability} folders use real names (Order/, Fulfillment/).
Architecture boundary tests (Pest)
Enforce Core cross-module isolation so Application/Domain of module A cannot import Application/Domain of module B.
php artisan test --compact tests/Unit/ModuleBoundaryArchTest.php
Typical guards:
- No foreign module namespaces inside Application/Domain
- No Eloquent models inside Application/Domain
- No PHP under a literal
*/Feature/path - When adding a module, append its name to the
$moduleslist in the arch test
Laravel Pint
Every PHP change should follow a shared pint.json (Laravel preset + project rules). Prefer Composer scripts:
composer lint # ./vendor/bin/pint
./vendor/bin/pint --dirty # while coding
./vendor/bin/pint --test # CI check-only
Useful alignments with Core naming:
| Area | Typical Pint focus |
|---|---|
| Class layout | traits → constants → properties → __construct → methods |
| Types | declare_strict_types, return types |
| Imports | ordered, unused removed |
Pint does not replace boundary tests.
PHPStan / Larastan
composer require --dev phpstan/phpstan larastan/larastan
Example phpstan.neon sketch:
includes:
- ./vendor/larastan/larastan/extension.neon
parameters:
phpVersion: 80400
level: 5
paths:
- app
Raise levels gradually. Static analysis catches illegal types that style tools miss.
Suggested local loop
- Implement behind ports (fake/in-memory in tests).
./vendor/bin/pint --dirty- Feature + unit tests for the Use Case.
ModuleBoundaryArchTestgreen.- PHPStan on touched paths.
Core reference: Anti-patterns · Decision tree.