simaocurado / axiom
Opinionated Laravel defaults for action-oriented architecture, strict typing, code quality, and team consistency.
Fund package maintenance!
Requires
- php: ^8.4
- illuminate/contracts: ^11.0||^12.0||^13.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.35
This package is auto-updated.
Last update: 2026-04-01 11:28:06 UTC
README
axiom is an opinionated package for Laravel projects that want stronger defaults from day one.
It brings the same direction used in my starter kits into an existing Laravel app: actions, DTOs, enums, stricter quality tooling, AI guidelines, and a more disciplined baseline for code generation and project setup.
Current target support: Laravel 11, 12, and 13.
What It Brings
- Action-oriented architecture
- DTO-first boundaries
- Final and readonly by default
- CRUD-oriented generators
- AI guidelines and modular AI skills
- Strict Laravel defaults
- Real quality presets for PHPStan, Rector, Pint, and Arch tests
- Optional project scripts and dependency presets
Installation
Install the package:
composer require simaocurado/axiom
Run the installer:
php artisan axiom:install
You can also run it non-interactively:
php artisan axiom:install \ --ai=boost \ --skills \ --actions \ --quality \ --strict \ --scripts \ --phpstan \ --rector \ --pint \ --type-coverage \ --debug-tool=debugbar \ --oxlint \ --prettier \ --concurrently \ --ncu
Installer Options
The installer can:
- publish
AGENTS.mdorCLAUDE.md - publish
.ai/skills/*.md - create
app/Actionsandapp/Dto - publish
phpstan.neon,rector.php,pint.json, andtests/Unit/ArchTest.php - publish a host
App\Providers\AxiomServiceProvider - register that provider in
bootstrap/providers.phpwhen available - add opinionated
composerscripts - add optional PHP tooling dependencies like PHPStan, Rector, Pint, Pest type coverage, Debugbar, and Telescope
- add optional frontend tooling dependencies like Oxlint, Prettier, concurrently, and npm-check-updates
Generated Structure
When you enable architecture-related options, the installer prepares the host project with:
app/Actionsapp/Dto.ai/architecture.md.ai/quality.md.ai/skills/actions.md.ai/skills/dto.md.ai/skills/enum.md.ai/skills/crud.md.ai/skills/quality.md
Commands
php artisan axiom:installphp artisan make:action Namephp artisan make:dto Namephp artisan make:enum Namephp artisan make:request Namephp artisan make:crud-action Model --operation=createCreates a CRUD-oriented action for a model workflow.
Composer Scripts
composer setupPrepares the project for local development.composer devStarts the local development workflow.composer lintRuns auto-fix quality tools like Rector and Pint.composer fix:rectorApplies Rector refactors.composer testRuns the full project quality and test suite.composer test:type-coverageRuns Pest type coverage.composer test:unitRuns the test suite.composer test:lintRuns lint checks without changing files.composer test:rectorRuns Rector in dry-run mode.composer test:typesRuns static analysis.composer update:requirementsUpdates project dependency constraints.composer configure:app-urlSets the localAPP_URLbased on the project directory name.
Quality Presets
When enabled, Axiom can publish:
phpstan.neonrector.phppint.jsontests/Unit/ArchTest.php
And it can prepare the host project with optional dependencies for:
- Larastan
- PHPStan
- Rector
- Pint
- Pest type coverage
- Oxlint
- Prettier
- frontend quality scripts
Published composer scripts include dedicated Rector commands:
composer fix:rectorcomposer test:rector
Strict Defaults
When strict defaults are enabled, the published host provider configures:
- immutable dates with
CarbonImmutable Model::shouldBeStrict(...)Model::automaticallyEagerLoadRelationships()
AI Guidelines And Skills
Axiom separates global guidance from task-focused workflows:
- guidelines:
AGENTS.md/CLAUDE.md - skills:
.ai/skills/*.md
This makes it easier to keep project rules stable while still giving AI tools focused instructions for actions, DTOs, enums, CRUD, and quality work.
Current Scope
This package is especially useful for fresh Laravel projects or projects that are still early enough to adopt stronger conventions without a painful migration.
It is not trying to replace Laravel. It is trying to make a Laravel app feel closer to my preferred defaults:
- reusable actions
- explicit DTOs
- thin controllers
- strict static analysis
- fail-fast feedback
- cleaner code generation
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.