nyoncode / laravel-package-console
Artisan-like generators and scaffolding for developing Laravel 12 and 13 packages, with first-class laravel-package-toolkit support
Package info
github.com/NyonCode/laravel-package-console
pkg:composer/nyoncode/laravel-package-console
1.2.0
2026-11-13 21:13 UTC
Requires
- php: ^8.2
- ext-mbstring: *
- ext-readline: *
- doctrine/inflector: ^2.0
- laravel/prompts: ^0.3
- nikic/php-parser: ^5.0
- symfony/console: ^7.2|^8.0
- symfony/finder: ^7.2|^8.0
- symfony/string: ^7.2|^8.0
- symfony/validator: ^7.2|^8.0
Requires (Dev)
- laravel/pint: ^1.24
- mockery/mockery: ^1.6
- pestphp/pest: ^3.8|^4.0
Suggests
- nyoncode/laravel-package-toolkit: Generated resources are registered through its fluent Packager API
Provides
None
Conflicts
None
Replaces
None
README
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.package:doctorthen finds the files your provider does not register, and registrations of files that are gone, and--fixregisters what is missing. - Asks instead of failing. In a terminal, a generator without a name asks for it and for
its options, with Laravel Prompts, in English or Czech. With
--no-interactionnothing is ever asked. - 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.