Scaffold Laravel Packages with the `laravel package` Command in Installer v5.31.0
Laravel Composer Pacakge #Laravel Installer #Package Development #CLI #GitHub Actions #Laravel

Scaffold Laravel Packages with the `laravel package` Command in Installer v5.31.0

3 min read Mohamed Said Mohamed Said

Laravel Installer v5.31.0: What's New

The Laravel team shipped Installer v5.31.0 on July 20, 2026, with several quality-of-life improvements for package authors and application developers alike. The headline feature is the new laravel package command, but the release also tightens CI configuration, improves Node-less workflows, and fixes a Windows-specific development issue.


The laravel package Command

You can now scaffold a new Laravel package directly from the terminal without manually cloning a skeleton repository:

laravel package my-new-package

Under the hood, the command:

  1. Clones the official laravel/package-skeleton repository.
  2. Cleans the git history so you start fresh.
  3. Installs Composer dependencies.
  4. Runs the skeleton's interactive configuration script.

Feature Flags

Run the command interactively or pass flags to predefine which components to include:

| Flag | Purpose | |---|---| | --config | Include a config file | | --routes | Include routes | | --views | Include views | | --translations | Include translations | | --migrations | Include migrations | | --assets | Include assets | | --commands | Include Artisan commands | | --facade | Include a facade | | --boost-skill | Include a Laravel Boost skill |

Metadata Options

You can also supply package metadata directly on the command line to skip interactive prompts:

laravel package my-new-package \
  --author-name="Jane Doe" \
  --author-email="jane@example.com" \
  --package-name="my-new-package" \
  --vendor-namespace="JaneDoe" \
  --package-description="A helpful Laravel package"

Available metadata flags include --package-name-human, --class-name, and the author/vendor options shown above. The command also integrates with the installer's non-interactive AI agent detection, making fully automated package scaffolding possible in CI or agentic workflows.


Automated PHP Version Matching for GitHub Actions

When you create a new project with a starter kit, the installer now reads the PHP version running on your local machine and writes that exact major.minor version into the generated .github/workflows/tests.yml file. Your CI pipeline will test against the same PHP version you develop with locally — no more manual edits to the workflow file after project creation.


--no-node Propagation to Starter Kit Hooks

Passing --no-node to laravel new now sets a LARAVEL_INSTALLER_NO_NODE=1 environment variable before any post-create starter kit hooks run. Starter kits that respect this variable can skip npm installs and other Node.js-dependent tasks automatically.


Fallback Prompt Output

The installer now guards the call to Laravel\Prompts\callout() with an existence check. If the function is unavailable — for example, when an older version of Laravel Prompts is installed — output falls back to standard output instead of throwing a fatal error.


Windows Queue Listener Timeout Fix

On Windows, the dev Composer script that runs concurrent processes during local development now passes --timeout=0 to php artisan queue:listen. This prevents the queue listener from stopping unexpectedly mid-session.


Upgrading

No breaking changes are expected. Update your globally installed installer with:

composer global update laravel/installer

Key Takeaways

  • laravel package <name> scaffolds a new package from laravel/package-skeleton in one command.
  • Feature flags (--config, --migrations, --facade, etc.) let you define the package structure upfront.
  • Metadata flags eliminate interactive prompts, enabling fully automated or AI-driven package creation.
  • GitHub Actions workflows now automatically mirror your local PHP version.
  • --no-node is now propagated to starter kit hooks via an environment variable.
  • Windows developers get a stable queue listener in the dev script.

Source: Laravel News — Scaffold Packages with the laravel package Command in Laravel Installer v5.31.0

Found this useful?

Frequently Asked Questions

3 questions
Q01 What does the `laravel package` command do in Laravel Installer v5.31.0?
It clones the official `laravel/package-skeleton` repository, clears the git history, installs Composer dependencies, and runs the skeleton's configuration script — all in a single CLI command. You can pass feature flags like `--migrations` or `--facade` and metadata options like `--author-name` to automate the setup.
Q02 How do I update to Laravel Installer v5.31.0?
Run `composer global update laravel/installer` in your terminal. No breaking changes are expected for typical applications.
Q03 What does the `--no-node` flag propagation mean for starter kits?
When you run `laravel new` with `--no-node`, the installer sets a `LARAVEL_INSTALLER_NO_NODE=1` environment variable before executing any post-create starter kit hooks. Starter kits that check for this variable can then skip npm installs and other Node.js-related tasks automatically.

Continue reading

More Articles

View all