Alexis Romot
Alexis Romot

Reputation: 534

Laravel/Lumen - How to trigger a job process from a website?

I'm using Lumen queues. To start the jobs being processed, the docs indicate to run the queue listener from the command line like so:

php artisan queue:listen

I'd like to trigger my queue jobs processes directly from my code. How to do so?

Upvotes: 3

Views: 1183

Answers (1)

Joseph Silber
Joseph Silber

Reputation: 220066

You can call any artisan command you like directly from your code:

Artisan::call('queue:listen');

For information, read the docs.

Upvotes: 2

Related Questions