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

Published on by

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

The Laravel team released Laravel Installer v5.31.0 with a new command to scaffold Laravel packages, environment variable propagation for node-less setups, automated PHP version matching for GitHub Actions, and various compatibility fixes.

  • New laravel package command to scaffold packages from the CLI
  • Automated PHP version matching for continuous integration workflow files
  • Propagation of the --no-node option to starter kit installer hooks
  • Fallback output when Laravel\Prompts\callout() is not available
  • Windows compatibility fix adding --timeout=0 to development queue listeners

What's New

The laravel package Command

You can now scaffold new Laravel packages directly from the command line. This command clones the official laravel/package-skeleton repository, cleans the git history, installs dependencies, and then runs the skeleton's configuration script.

To create a new package:

laravel package my-new-package

By default, the command runs interactively, prompting you for package configuration and details. It also supports various flags to predefine your package's features:

  • --config: Include a configuration file
  • --routes: Include routes
  • --views: Include views
  • --translations: Include translations
  • --migrations: Include migrations
  • --assets: Include assets
  • --commands: Include commands
  • --facade: Include a facade
  • --boost-skill: Include a Laravel Boost skill

You can also pass metadata options directly:

  • --author-name: Author name
  • --author-email: Author email
  • --package-name: Package name
  • --package-name-human: Package display name
  • --package-description: Package description
  • --vendor-namespace: Vendor namespace
  • --class-name: Main class name

The command works with the installer's non-interactive AI agent detection, allowing agents to automate package setup.

PR: laravel/installer#546

Local PHP Version Matching in CI Workflows

When setting up a starter kit, the installer now detects the PHP version running on your local machine and configures the generated GitHub Actions workflow (.github/workflows/tests.yml) to use the same major and minor version. This ensures that your continuous integration environment tests against the same PHP version you use for local development.

PR: laravel/installer#553

Propagating --no-node to Starter Kit Hooks

If you run laravel new with the --no-node flag, the installer now passes a LARAVEL_INSTALLER_NO_NODE=1 environment variable to any post-create starter kit hooks. This allows starter kits to bypass npm and Node-related tasks when you want to avoid Node.js dependencies.

PR: laravel/installer#552

Fallback Prompt Output

The installer now checks for the existence of Laravel\Prompts\callout() before invoking it. If the function is not available (for example, when running with older versions of Laravel Prompts), the installer falls back to writing directly to the standard output rather than throwing an error.

PR: laravel/installer#549

Windows Queue Listener Timeout Fix

During local development setup on Windows, the installer configures the dev script in composer.json to run processes concurrently. To prevent the queue listener from stopping unexpectedly, this update adds the --timeout=0 flag to php artisan queue:listen.

PR: laravel/installer#550

Upgrade Notes

No breaking changes are expected for typical applications. To update your globally installed Laravel installer, run:

composer global update laravel/installer

References

Yannick Lyn Fatt photo

Staff Writer at Laravel News and Full stack web developer.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Laravel Code Review

Get expert guidance in a few days with a Laravel code review

Visit Laravel Code Review
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media

The latest

View all →
The Analytics Stack for Laravel: Traffic, Revenue and Attribution in One Place image

The Analytics Stack for Laravel: Traffic, Revenue and Attribution in One Place

Read article
Vocalizer: Local Text-to-Speech for PHP image

Vocalizer: Local Text-to-Speech for PHP

Read article
Build a Laravel Scout Search Endpoint With the HTTP QUERY Method image

Build a Laravel Scout Search Endpoint With the HTTP QUERY Method

Read article
Enforce Per-Action Waiting Periods in Laravel with Cooldown image

Enforce Per-Action Waiting Periods in Laravel with Cooldown

Read article
First-Party Image Processing in Laravel 13.20 image

First-Party Image Processing in Laravel 13.20

Read article
Laravel Legacy Bridge: Carry Authenticated Sessions from a Legacy App into Laravel image

Laravel Legacy Bridge: Carry Authenticated Sessions from a Legacy App into Laravel

Read article