I just finished the queuing process and it's going well but not as I imagined.
Create the job table all as per the laravel documentation.
In queue.php I added the following command:
'default' => env('QUEUE_CONNECTION', 'database'),
in the .env
QUEUE_CONNECTION=database
I call the queue:
ProcesarImagenes::dispatch($galeria);
And I use it normally:
public function handle()
{
$img = $this->galeria['imagenesGaleria'];
$rut = $this->galeria['ruta'];
//make recibe la imagen
Image::make($img)
->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
})
->save($rut);
}
Now this resizes the image perfectly. But in the JOB table nothing happens, run the command:
php artisan queue:work
[2020-12-07 18:12:47][4] Processing: App\Jobs\ProcesarImagenes
[2020-12-07 18:12:50][4] Processed: App\Jobs\ProcesarImagenes
What did I miss?? where are you running them from? Why are there no records in my table?
I found in \bootstrap\cache\config.php
So make the change to:
And run:
This solved my problem.