ldc-crm/app/Jobs/StartStatJobs.php
Alexis Gousseau 303834bbca
Crm V4
- Make all tests pass Client (V4),CRMV2,CRMV4
- Simplify client submodule path
- Move App_url to .env.testing
2023-10-06 16:37:29 +02:00

30 lines
602 B
PHP

<?php
namespace App\Jobs;
use App\Models\Brand;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
class StartStatJobs implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
/**
* Execute the job.
*
* @return void
*/
public function handle(): void
{
$brands = Brand::all();
foreach ($brands as $brand) {
\dispatch(new StatJob($brand))
->delay(rand(0, 90));
}
}
}