laravel/installer
Laravel Installer is the official command-line tool for creating new Laravel applications. Install globally via Composer and run laravel new to scaffold a fresh project quickly, with the latest framework version and starter setup.
The laravel/installer package is a command-line tool designed to streamline Laravel project bootstrapping, aligning well with developer tooling and infrastructure-as-code (IaC) workflows. It abstracts the complexity of:
.env, APP_URL, database drivers)Key Fit Areas:
Misalignment Risks:
.env updates post-deploy).| Integration Vector | Feasibility | Notes |
|---|---|---|
| Composer-Based Workflows | High | Directly compatible with composer create-project. |
| CI/CD Pipelines | High | Can be invoked via composer require + custom scripts. |
| Custom Starter Kits | Medium | Requires packaging a Laravel-compatible template (e.g., Git repo). |
| Monorepos | Low | Not designed for multi-project setups; may conflict with root composer.json. |
| Legacy Laravel Apps | Medium | May need --preserve flags to avoid overwriting existing configs. |
| Non-PHP Stacks | Low | Tightly coupled to Laravel’s ecosystem (e.g., assumes PHP, Composer). |
Key Dependencies:
| Risk Area | Severity | Mitigation |
|---|---|---|
| Cross-Platform Quirks | Medium | Test on target OS (e.g., Windows path handling, bunx vs. npx). |
| Dependency Conflicts | Low | Isolate in a dev dependency or use --ignore-platform-reqs. |
| Custom Kit Security | High | Validate Git repos for malicious postinstall scripts (see PR #489). |
| Version Skew | Medium | Pin to a specific laravel/installer version in composer.json. |
| Interactive Mode in CI | High | Use --no-interaction or --preset flags for automation. |
| Boost Integration | Medium | Ensure laravel/boost compatibility (v2.2+ for Inertia v3). |
Critical Questions for TPM:
composer create-project or augment it?.env or APP_URL need post-install overrides?composer.lock corruption)?| Component | Compatibility | Notes |
|---|---|---|
| Laravel Core | High | Officially maintained by Laravel team. |
| Composer | High | Leverages create-project under the hood. |
| Node.js/Package Managers | Medium | Supports npm, yarn, pnpm, bun (via flags). |
| CI Systems | High | Works with GitHub Actions, GitLab CI, etc. (non-interactive mode). |
| Docker/Kubernetes | Medium | Can be used in Dockerfile but may need layer caching optimizations. |
| Windows Dev Environments | Medium | Some prompts/paths may require adjustments (see PR #478, #507). |
Phase 1: Developer Onboarding
composer create-project with:
composer require laravel/installer --dev
laravel new project-name --preset=minimal
--database=mysql, --no-boost).Phase 2: CI/CD Integration
- name: Scaffold Project
run: |
composer require laravel/installer --dev
laravel new ./app --preset=minimal --no-interaction
Phase 3: Custom Templates
laravel new ./app --starter=git@github.com:org/custom-kit.git
composer.json to alias create-project:
"scripts": {
"new": "laravel new"
}
laravel/installer globally or as a project dependency.| Scenario | Compatibility | Workaround |
|---|---|---|
| Laravel <10 | Low | Use laravel/installer:4.x branch. |
| Non-Composer Workflows | Low | Not applicable; requires Composer. |
| Monorepos | Low | Run in a subdirectory or use --preserve. |
| Air-Gapped Environments | Medium | Pre-download dependencies or use --ignore-platform-reqs. |
| Custom Composer Plugins | Medium | May conflict with laravel/installer's postinstall hooks. |
Recommended Execution Order:
laravel new with appropriate flags (e.g., --preset, --database).--database was specified).laravel/installer alongside Laravel core.Anti-Patterns to Avoid:
--no-interaction).composer install scripts (may cause conflicts).| Aspect | Effort | Notes |
|---|---|---|
| Version Updates | Low | Follow Laravel’s release cycle (e.g., update when Laravel 14 drops). |
| Dependency Management | Medium | Monitor laravel/prompts, symfony/console, and Node tooling updates. |
| Custom Kit Updates | High | Requires manual sync if using private repos. |
| CI/CD Maintenance | Low | Minimal; just update the laravel new command. |
Maintenance Tasks:
laravel/installer for breaking changes.| Issue Type | Likelihood | **Resolution Path
How can I help you explore Laravel packages today?