Questions tagged [laravel-jobs]
135 questions
2
votes
0 answers
Laravel queue, redirect after dispatch
I have job class in my package. Function is simple but time consuming. I'd like send it to run in background.
php artisan queue:work
works.

jaroApp
- 849
- 3
- 13
- 27
1
vote
1 answer
Laravel 9 PHP 8 - Issue with batch cancelling
I'm using Laravel 9 with PHP 8.0.
I would like to launch several hundred jobs one after the other.
I initialized my jobs by storing them in "recognitionsBus". Then ran the batch.
I tried to reduce the job to the minimum to just log information, but…

Jo--
- 11
- 2
1
vote
2 answers
how to run the jobs queue immediately after a job added to queue in laravel?
I currently registered php artisan schedule:run in cronjob in cpanel and the schedule method is:
protected function schedule(Schedule $schedule)
{
$schedule->command('queue:work --stop-when-empty')
->cron('* * * * *')
…

aref razavi
- 413
- 2
- 12
1
vote
3 answers
Laravel release(delay) function releases job again immediately
The problem:
I have a job in Laravel, based on the condition that an API is reachable it should either run or be released a day later.
The condition to check if the API is reachable works perfectly. The problem, however, occurs when the job is…

geertjanknapen
- 1,159
- 8
- 23
1
vote
1 answer
Why laravel dispatcer dispatch() function not creating jobs in jobs table of particular database?
I have multiple databases and switching database as per some conditions before dispatching jobs. For eg:
if(condition A){
DB::setDefaultConnection('A');
} else {
DB::setDefaultConnection('B');
}
dispatch(new CreateNewUser($user))
And the db…

amit
- 353
- 1
- 3
- 19
1
vote
2 answers
Laravel Job Withcount Parameter not Accessible in job Laravel 5.6
Hii I created a job to send mail. I execute a query in the controller using withCount() and am able to get the count parameter inside the controller but while I am parsing the same data to the job and assign to a local variable in constructer then I…

Bhimani Rutvik
- 398
- 2
- 13
1
vote
0 answers
Database changes not working when exception is thrown in queue/job
Im dispatching jobs that makes use of a table containing unprocessed data fetched from a file from an ftp server; which this job should process and insert or update on a separate table.
In my job file I have the following code
public function…

Rick
- 2,003
- 4
- 16
- 28
1
vote
1 answer
How do I log properly a Laravel Job?
Reading the official documentation I understand that it's necessary to use Illuminate\Support\Facades\Log, but the configuration in logging.php is a bit confusing to me. I basically don't understand how the channel drivers work, it seems to me a bit…

Endervay
- 37
- 1
- 7
1
vote
0 answers
Handle function in Laravel job class is not working but the constructor in job class working.Why?
dispatch((new placeJob($data))->onQueue('important'));
this line calls the job constructor, but log statement and any other statement in handle function is not working.
i'm trying to dispatch the job. but the handle function in job is not…

arunaji601
- 11
- 4
1
vote
1 answer
while error thrown by artisan custom command, it is not getting caught in laravel exception handler
When running custom artisan command which dispatches job, if any exception occur in job it should call handler.php but it doesn't get called.
I need to send an email for each type of exception caught in job.

akshay mahindre
- 21
- 1
1
vote
0 answers
Laravel jobs and views
I'm facing a problem i don't really understand it. I'm using Laravel 8 jobs to save my blade view as an html page in my public folder. In my main view I have to load another view and pass it a path to the image which stored in the public folder as…

somnso
- 37
- 5
1
vote
1 answer
Laravel Queue Executes Twice
I am using laravel notifications with queues. Here's my code:

Pranta
- 2,928
- 7
- 24
- 37
1
vote
1 answer
Laravel jobs being processed but not doing anything
I have checked multiple answers regarding this issue but didn't seem to have a proper solution. I'm firing a job, and it's working well in sync mode, but not working at all in database driver.
queue.php
'default' => env('QUEUE_CONNECTION',…

Jaeger
- 1,646
- 8
- 27
- 59
1
vote
0 answers
Php unit test with redis has segmentation fault
Recently I bought a mac with an m1 chip. When I run my phpunit tests in a laravel 8 project with php8 I get this error message:
80630 segmentation fault vendor/bin/phpunit
It looks related to redis because only tests go wrong where redis, is used…

Jamie
- 10,302
- 32
- 103
- 186
1
vote
1 answer
How to Chain Bus::chain() in laravel
I have three Laravel Parent jobs name
AutoPOChargeCalculation::dispatch($invoice_id, $user_id, $notify)->onQueue('invoice');
AutoSOChargeCalculation::dispatch($invoice_id, $user_id, $notify)->onQueue('invoice');
…
user13134426