Hy! I have an application where I have to send some emails at certain actions (such as user creation, etc.). Problem is they are not running in the background, instead I have to wait until the process is done, and then it redirects me to another page.
I use database driver with queues, Laravel 5.2.
My code for email, for exp, after user creation:
$this->dispatch(new WelcomeEmail($user));
Artisan::call('queue:work');
where WelcomeEmail is the job that is pushed on queue. This type of code is placed in all the places where I want an email to be send. What is wrong?