laravel - php artisan --queue parameter error!

WBOY
Release: 2023-03-02 12:50:01
Original
1663 people have browsed it

Error message:
laravel - php artisan --queue parameter error!

Reply content:

Error message:
laravel - php artisan --queue parameter error!

make is the command to create a php file. The make:command in your screenshot is to create a command line task. For example, if you create a command test, you can execute php artisan test on the command line to execute it. This test task.

Tasks used for queue execution generally use "Job". Create a job class through php artisan make:job, and then use dispatch(new FooJob) in the code to execute this task. If you need this job to be executed in a queue (asynchronously), the job class can implement ShouldQueue. After adding the job to the queue, the queue itself must be started to ensure that the added job can be executed as planned. To start the queue, use the php artisan queue:work command line. The official documentation explains these very clearly, and you can figure it out after reading it several times and trying it out.
https://laravel.com/docs/5.3/...
Chinese: https://laravel-china.org/doc...

When creating an event listener (listener) file, you can add parameters queued to mark that this listener needs to be executed asynchronously in the queue, such as php artisan make:listener Foobar --queued, defined in EventServiceProvider The corresponding relationship between event and listener is established. Use the event() function in the code to trigger an event. The framework will call its code based on the listener defined in the EventServiceProvider. If the listener is queued, it will be added to the queue.

Events, tasks, monitoring, and notifications in Laravel are all related to queues. But command (command line) has nothing to do with queues. Command can be understood as a command line tool executed after php artisan. The command line tool can be added to the system's scheduled task cron to execute according to the planned time, such as restarting the server at 3 am every day. Laravel provides a convenient method to implement system cron scheduled tasks, which can be written in the schedule method in app/Console/Kernel.php.

The --queued option does not exist, what do you want to do

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template