2021-10-29 12:53:46 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Jobs;
|
|
|
|
|
|
|
|
|
|
use App\Models\Brand;
|
2021-10-29 17:32:30 +02:00
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
2021-10-29 12:53:46 +02:00
|
|
|
|
2021-10-29 17:32:30 +02:00
|
|
|
class StartStatJobs implements ShouldQueue
|
2021-10-29 12:53:46 +02:00
|
|
|
{
|
2021-10-29 17:32:30 +02:00
|
|
|
use Dispatchable;
|
|
|
|
|
use InteractsWithQueue;
|
|
|
|
|
use Queueable;
|
2021-10-29 12:53:46 +02:00
|
|
|
|
2021-12-19 15:57:24 +01:00
|
|
|
/**
|
|
|
|
|
* Execute the job.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
2023-09-06 17:24:53 +02:00
|
|
|
public function handle(): void
|
2021-10-29 12:53:46 +02:00
|
|
|
{
|
|
|
|
|
$brands = Brand::all();
|
|
|
|
|
foreach ($brands as $brand) {
|
2021-10-29 17:32:30 +02:00
|
|
|
\dispatch(new StatJob($brand))
|
2021-11-05 16:22:36 +01:00
|
|
|
->delay(rand(0, 90));
|
2021-10-29 12:53:46 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|