News

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

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

Sponsored

acquaintsoft logo
Acquaint Softtech

Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Visit Acquaint Softtech

The latest

View all →
Laravel Truss: Live Interactive Database ER Diagrams image

Laravel Truss: Live Interactive Database ER Diagrams

Read article
Laravel artisan dev: Run Server, Queue, Logs, and Vite image

Laravel artisan dev: Run Server, Queue, Logs, and Vite

Read article
Validate and Convert HEIC Images in Laravel image

Validate and Convert HEIC Images in Laravel

Read article
Saga Lara Flow: Durable Workflows and Compensating Transactions on Laravel Queues image

Saga Lara Flow: Durable Workflows and Compensating Transactions on Laravel Queues

Read article
Reject Unexpected Array Keys with Laravel Validation image

Reject Unexpected Array Keys with Laravel Validation

Read article
Major performance improvements & security patches for Filament v4.12 and v5.7! image

Major performance improvements & security patches for Filament v4.12 and v5.7!

Read article