Questions tagged [laravel-jobs]
135 questions
10
votes
1 answer
The "--queued" option does not exist in Laravel 5.4
I'm going to create Queue job for mailing. once I hit the artisan command in command prompt php artisan make:job SendSMSMessages --queued I got the issue as is follow.
The "--queued" option does not exist.
I'm using Laravel 5.4
Please anyone can…

HItesh Tank
- 636
- 1
- 6
- 13
9
votes
3 answers
laravel deserialize/decode job raw body
i'm experiencing one problem here. Sample will speak for it self.
Queue::after(function (JobProcessed $event) {
$job_details = json_decode($event->job->getRawBody(), true);
)});
This is how $job_details looks like:
'displayName' =>…

Branko Dragovic
- 185
- 4
- 16
8
votes
1 answer
Run Laravel Horizon as a background service
My question is what is the best and simple way to run the Laravel Horizon based job workers?
My Tech Stack
Laravel 5.5
Horizon
Redis Queues
Centos
I have gone through the document https://laravel.com/docs/5.5/horizon
How to setup following…

BetaDev
- 4,516
- 3
- 21
- 47
7
votes
4 answers
Laravel Queue and Jobs - How to re run failed job later on
Thank you in advance
My question is simple
For example, I have created one job which is sending an email to the user. however it is failed due to some syntax error or any other exception, so laravel will consider this job as a failed job in the…

Ronak Solanki
- 341
- 2
- 5
- 14
7
votes
4 answers
Laravel - Execute queued job automatically
I have jobs to send several emails.
In my controller I call the job:
dispatch(new SendStartPatEmail($data));
And record is saved in table jobs.
But to execute the job I have to run php artisan queued:work manually.
How can I do this automatically?

user3242861
- 1,839
- 12
- 48
- 93
7
votes
4 answers
How could I dispatch one job from another in Laravel
Trait method dispatch has not been applied, because there are collisions with other trait methods on
I'm always getting the above error, now I want to use both Dispatchable and DispatchJobs in a job, how could I do that? Any help or guidance will…

Siddharth
- 1,649
- 4
- 22
- 47
7
votes
1 answer
laravel Job / Queue not been processed weird infinite loop
I'm trying to create a queue but it doesn't work when I run php artisan queue:work all I get in my terminal is
[2017-11-30 19:56:27] Processing: App\Jobs\ProcessCSV
[2017-11-30 19:56:27] Processing: App\Jobs\ProcessCSV
[2017-11-30 19:56:27]…

CIB
- 535
- 1
- 12
- 35
5
votes
3 answers
Laravel delete job once it fails
I have a job that times out and once it fails it dispatches another one just like itself so that it can run infinitely and without overlapping. However the job that fails stays in the queue and gets re-tried so I eventually have more than one job…

PU2014
- 323
- 5
- 17
5
votes
2 answers
Laravel jobs (database) do not execute handle
I have a problem with laravel jobs.
I configured laravel jobs to work with the database and it is working.
When I execute a job, the entry is created in database and the constructor is well executed.
However, the handle function is never executed…

tom1337
- 228
- 3
- 11
5
votes
0 answers
Laravel job runs twice when dispatched
I am trying to run a simple job within Laravel queues. The following is my Job.
class SearchFromSource extends Job implements SelfHandling, ShouldQueue
{
use InteractsWithQueue, SerializesModels;
public function handle()
{
echo…

Alireza
- 215
- 1
- 3
- 13
4
votes
2 answers
Retry a MaxAttemptsExceededException Job
I have multiple failed jobs on by failed_jobs. I tried requeue the MaxAttemptsExceededException but alwails fails. How to retry there type of jobs?
Note: Every time that I requeuing the job by php artisan queue:retry
id command the jobs fails…

Miguel Borges
- 7,549
- 8
- 39
- 57
3
votes
1 answer
laravel 9 scheduled job executed but not queued
I recognised a strange behavior after upgrading laravel from 8 to 9. I have a scheduler that executes some jobs.
Kernel.php:
$schedule->job(new ImportAzApplications, 'imports')
->everyFiveMinutes()
->onOneServer()
->onFailure(function ()…

lordisp
- 634
- 9
- 21
3
votes
1 answer
Check how many Jobs are processed in one second?
I'm trying to implement Rate Limiting using Redis. I need to call an API that has TPS 100 or that can be called 100 times in every second. I've a limitation that I cannot call API for testing. How can I test that my API is called not more than 100…

Najmus Sakib
- 737
- 8
- 12
3
votes
2 answers
Laravel 7 set log path dynamically in Job class
Im building project on Laravel 7.3 with multiple Jobs that run at the same time.
I need to make each Job write logs to different daily rotated file. The name of the log file should be based on model, that Job is processing.
The issue is I cant find…

966p
- 535
- 2
- 7
- 17
3
votes
1 answer
How to retry a job after x minutes?
I need to retry a job after 7 minutes after failed.
I try with $this->release(7); but on sometimes the job is running more that 1 time.

Miguel Borges
- 7,549
- 8
- 39
- 57