laravel-package-console maintained by nyoncode
Description
Artisan-like generators and scaffolding for developing Laravel 12 and 13 packages, with first-class laravel-package-toolkit support
Author
Last update
2026/11/07 00:08
(dev-main)
License
Downloads
12
Anvil: an Artisan-like console for Laravel packages
Anvil is php artisan make:* for people who build Laravel packages. It supports Laravel 12 and 13.
php anvil make:model Post -a
INFO Model [src/Models/Post.php] created successfully.
INFO Factory [database/factories/PostFactory.php] created successfully.
INFO Migration [database/migrations/create_posts_table.php] created successfully.
DONE Registered ->hasMigrations() in src/BlogServiceProvider.php.
INFO Seeder [database/seeders/PostSeeder.php] created successfully.
DONE Registered ->hasSeeders() in src/BlogServiceProvider.php.
INFO Controller [src/Http/Controllers/PostController.php] created successfully.
INFO Policy [src/Policies/PostPolicy.php] created successfully.
package:initcreates or completescomposer.jsonand scaffolds the package:- a service provider and a config file;
- Pest + Testbench, Larastan and Pint;
- a GitHub Actions matrix for PHP × Laravel.
- 34
make:*commands write each file in your package's namespace and register it in your service provider:- with laravel-package-toolkit, as
->hasX()calls inconfigure(); - with spatie/laravel-package-tools, as
->hasX()calls inconfigurePackage(); - with a plain Laravel
ServiceProvider, as the standard calls inregister()/boot().
- with laravel-package-toolkit, as
- Works with existing packages.
package:initcompletescomposer.jsonand keeps your provider, test setup and CI. - Registration is idempotent. It only adds what is missing and never reformats your code.
- Every generated file passes Pint and Larastan. Integration tests install a generated package on Laravel 12 and 13 and check every registration in a running application.
Installation
composer require --dev nyoncode/laravel-package-console
vendor/bin/anvil package:init
php anvil list
Requires PHP 8.2+.
Documentation
The full documentation is in docs/:
- Installation and Quickstart
- Creating a package
- Service provider registration: exactly what each generator adds, with the toolkit, with spatie/laravel-package-tools and with a plain provider
- Command reference
- Customising stubs
Testing
composer test # unit and feature tests
composer test:integration # installs generated packages on Laravel 12 and 13 (needs network)
See Contributing.
Changelog
See CHANGELOG.
License
The MIT License (MIT). See LICENSE.