Custom Laravel Community Starter Kits: Extending the Installer
Overview of Community Starter Kits
Laravel 12 has introduced a paradigm shift in how developers initialize projects. With the release of --using parameter, the installer now acts as a flexible bridge to the wider ecosystem.
Prerequisites and Requirements
Before utilizing this feature, ensure you have the
Key Libraries & Tools
- Laravel Installer 5.14: The command-line tool that facilitates the
--usingflag. - Tony Lee's Registry: A curated repository by Tony Leelisting available community kits.
- Packagist: The primary PHP package repository where these starter kits must reside.
- Laravel 12: The underlying framework version supported by these new scaffolds.
Code Walkthrough: Implementing Custom Kits
To install a specific community kit, use the following syntax in your terminal:
laravel new my-project --using="vendor/package"
Behind the scenes, the installer modifies the standard composer create-project command. It replaces the default
For kit creators, your composer.json must include a post-create-project-cmd to handle setup tasks like environment configuration:
"scripts": {
"post-create-project-cmd": [
"@php artisan app:install-features",
"@php artisan migrate"
]
}
Practical Examples: Blade and LaraSonic
A standout example is the
Tips & Gotchas
Community kits come with no official guarantee from the
