Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Installer Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

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:

  • Composer dependency resolution
  • Environment configuration (.env, APP_URL, database drivers)
  • Optional tooling (Node.js, Laravel Boost, Pest, Svelte, etc.)
  • Cross-platform compatibility (Windows/Linux/macOS)

Key Fit Areas:

  1. Standardized Onboarding: Reduces manual setup steps for new Laravel projects, improving consistency across teams.
  2. Customization Hooks: Supports starter kits, database auto-configuration, and interactive prompts—useful for templatized deployments.
  3. Integration with CI/CD: Can be embedded in pipelines (e.g., GitHub Actions) to automate project scaffolding.
  4. Legacy Compatibility: Backward-compatible with Laravel 10–13, ensuring gradual adoption.

Misalignment Risks:

  • Not a Runtime Dependency: This is a build-time tool, not a production library. Misuse (e.g., calling it dynamically in app logic) would introduce unnecessary overhead.
  • Limited Post-Install Hooks: While it handles initial setup, it doesn’t manage runtime configurations (e.g., .env updates post-deploy).

Integration Feasibility

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:

  • Composer (v2+ recommended)
  • PHP (8.1–8.5, per Laravel 10–13 support)
  • Optional: Node.js (for frontend tooling), Git (for custom kits)

Technical Risk

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:

  1. Use Case Clarity:
    • Is this for developer onboarding, CI/CD scaffolding, or custom templates?
    • Will it replace manual composer create-project or augment it?
  2. Customization Needs:
    • Are custom starter kits required? If so, how will they be validated?
    • Will .env or APP_URL need post-install overrides?
  3. CI/CD Impact:
    • How will interactive prompts (e.g., database selection) be handled in pipelines?
    • Will this run in parallel with other setup steps (e.g., Docker builds)?
  4. Rollback Plan:
    • How will failed installs be recovered (e.g., partial composer.lock corruption)?
  5. Long-Term Maintenance:
    • Who will update the installer version as Laravel evolves?
    • Will this be vendor-locked or centrally managed?

Integration Approach

Stack Fit

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).

Migration Path

Option 1: Incremental Adoption (Recommended)

  1. Phase 1: Developer Onboarding

    • Replace manual composer create-project with:
      composer require laravel/installer --dev
      laravel new project-name --preset=minimal
      
    • Document custom flags (e.g., --database=mysql, --no-boost).
  2. Phase 2: CI/CD Integration

    • Add to pipeline (example GitHub Actions):
      - name: Scaffold Project
        run: |
          composer require laravel/installer --dev
          laravel new ./app --preset=minimal --no-interaction
      
  3. Phase 3: Custom Templates

    • Package a Laravel-compatible starter kit (e.g., Git repo) and reference it:
      laravel new ./app --starter=git@github.com:org/custom-kit.git
      

Option 2: Full Replacement

  • Update composer.json to alias create-project:
    "scripts": {
      "new": "laravel new"
    }
    
  • Require laravel/installer globally or as a project dependency.

Compatibility

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.

Sequencing

Recommended Execution Order:

  1. Pre-Install:
    • Validate PHP/Composer versions.
    • Check for required tools (Node.js, Git, etc.).
  2. Install:
    • Run laravel new with appropriate flags (e.g., --preset, --database).
  3. Post-Install:
    • Run migrations (if --database was specified).
    • Configure CI/CD to avoid duplicate scaffolding.
  4. Ongoing:
    • Update laravel/installer alongside Laravel core.

Anti-Patterns to Avoid:

  • Running in production environments (this is a dev tool).
  • Using interactive mode in CI (always use --no-interaction).
  • Mixing with custom composer install scripts (may cause conflicts).

Operational Impact

Maintenance

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:

  • Quarterly: Audit laravel/installer for breaking changes.
  • Annual: Review custom starter kits for compatibility.
  • As Needed: Update Node.js/PHP versions in CI templates.

Support

| Issue Type | Likelihood | **Resolution Path

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/entity-migrator
codraw/doctrine-extra
codraw/aws-tool-kit
codraw/validator
codraw/workflow
codraw/open-api
codraw/cron-job
codraw/process
codraw/log
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony