Laravel commands and jobs

前端 未结 3 1142
死守一世寂寞
死守一世寂寞 2021-01-30 17:35

I was wondering what the difference is between the different command-like classes in Laravel 5.1. As far as I can tell Laravel 5.1 has the following available:

  • Con
3条回答
  •  执念已碎
    2021-01-30 18:00

    Just an addition to the actual answers.

    Jobs in Laravel >= 5.1 are Commands Bus in Laravel 5.0.

    It is only a naming change because of the confusion between Console\Commands (commands run from the console) and The Command Bus (containing Commands) for the Application Tasks.

    You should not confound :

    • Command Bus : used for "encapsulating tasks your application" (from laravel 5.0 doc) which is now renamed a Jobs
    • Console\Commands : used for "Artisan [...] the command-line interface included with Laravel" (from laravel 5.1 docs) which is unchanged in Laravel since 4.x

提交回复
热议问题