1

I am working now in Laravel 5.4 and configured the queue driver as database and created the jobs migration.

Controller

public function addUser(){
    $job = (new SendReminderEmail())->delay(Carbon::now()->addSeconds(200));
    dispatch($job);

    dd('Job Completed');
}

Queue

public function handle()
{
    $input = ['name'=>'John','email'=>str_random(7),'password'=>Hash::make('general'),];
    DB::table('users')->insert($input);
}

This process successfully inserting job row in jobs table. But I gave 200 seconds for execution delay. But its not firing after time reaches.

How this happening ? Is there any configuration needed more to work queues. ?

1 Answer 1

2

Run php artisan queue:listen or php artisan queue:work. These must be run for Artisan to bootstrap the application and run in the background checking for new queue jobs, without it the only queue type that will work is 'sync'.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.