Customizing Laravel Dev Command: Excluding Vendor Processes

Learn how to use Laravel 13.30's new DevCommands methods to exclude vendor and default processes from 'php artisan dev' for a cleaner workflow.

Code snippet showing DevCommands::withoutVendorCommands in Laravel

Laravel 13.30 introduces enhanced control over the php artisan dev command, allowing developers to fine-tune their local environment. By default, this command runs various development processes such as Vite or vendor-specific watchers. However, in specific application architectures, you might want to exclude these to prevent overlap or reduce resource usage.

You can now utilize the DevCommands facade to filter which processes are triggered. The two primary methods introduced are:

  • DevCommands::withoutVendorCommands(): Prevents processes registered by third-party packages from running.
  • DevCommands::withoutDefaultCommands(): Skips the standard Laravel development processes.

By implementing these in your service provider, php artisan dev will only execute the specific processes you have manually registered for your application.

Sources

  • https://laravel-news.com/artisan-dev-exclude-vendor-commands

Share

Pass this post along on Telegram, WhatsApp, or copy the link.

Telegram WhatsApp

Keep Reading

Related Posts

More Writing

Explore the full blog

Browse more articles on backend systems, APIs, and building reliable products.

All Posts