PHP Artisan Dev Now Only Runs Application Commands

With new methods added to the DevCommands class in Laravel 13.30, php artisan dev now runs only the project's own commands, excluding vendor packages and Laravel defaults.
PHP Artisan Dev Now Only Runs Application Commands - bimakale.com
07 Eylül 2026 Pazartesi - 12:01 (1 Saat önce) 3 dk okuma

Introducing the New Methods

Laravel version 13.30 reshapes the behavior of the php artisan dev command by adding two new functions to the DevCommands class. The withoutVendorCommands() and withoutDefaultCommands() methods allow developers to run only application-specific commands. As a result, default commands provided by package managers or the Laravel core are automatically excluded from the dev process.

Why Is This Change Necessary?

In modern projects, the number of commands provided by third-party packages is growing rapidly. Especially in large teams, triggering unnecessary commands when running a development tool like php artisan dev degrades performance and complicates debugging. These new methods solve this problem by isolating only the commands registered by the application itself.

How to Use It in Your Application

Developers can chain DevCommands::withoutVendorCommands()->withoutDefaultCommands(); inside AppProvidersAppServiceProvider or a similar service provider. This line executes as soon as the php artisan dev command is initiated, running all subsequent operations through this filtered command set. This means core Laravel utilities like queue:work or schedule:run will not run in the dev environment, leaving only custom commands defined within the project.

Impact on Developer Experience

This update brings benefits in two key areas. First, speed—skipping unnecessary commands shortens Artisan's boot time. Second, reliability—running only application-related commands prevents unexpected side effects in testing environments. Consistent results from the php artisan dev command improve the stability of automated tests, especially within CI/CD pipelines.

Performance Benchmarks

Although no specific benchmarks were provided in the announcement, reducing the command count is expected to lower I/O and memory consumption. Developers can inspect command lists in their projects using the --verbose flag to see which packages provide commands and verify filtering.

Potential Limitations and Considerations

While excluding package commands from the dev environment is beneficial in most scenarios, commands provided by certain packages can play a critical role during development. For instance, monitoring tools like laravel/telescope offer Artisan commands to collect insights during development. In such cases, you may need to disable the withoutVendorCommands() method or create a separate configuration for specific packages.

Additionally, Laravel's default commands include code generators like make:model. These commands save time when creating new classes and are often an indispensable part of the development workflow. Projects enabling the withoutDefaultCommands() method may need to provide these helper commands manually or through an alternative script.

Expected Developments in Future Releases

These two methods may signal finer configuration options coming to the Laravel ecosystem. Future releases will likely add features like selectively excluding specific vendor packages or filtering commands by groups. For now, it simplifies the core functionality of the php artisan dev command, giving developers a cleaner workspace.

In summary, the withoutVendorCommands and withoutDefaultCommands methods introduced in Laravel 13.30 clean up the development environment from unnecessary dependencies, delivering a faster and more predictable Artisan experience. By adopting this update in their projects, developers can ensure that only code relevant to their application runs, minimizing the risk of potential conflicts.

Source: Laravel News

Kaynak: Laravel News

Alakalı İçerikler


  • Laravel
  • php artisan
  • dev commands
  • withoutVendorCommands
  • withoutDefaultCommands
  • geliştirme ortamı
  • komut filtreleme



Comments
Add your comment
Kullanıcı
0 character
Other Tags by the Author Show all
Popular Tags Show all
Other content by the author