Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
StartStatJobs
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 handle
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace App\Jobs;
4
5use App\Models\Brand;
6use Illuminate\Bus\Queueable;
7use Illuminate\Contracts\Queue\ShouldQueue;
8use Illuminate\Foundation\Bus\Dispatchable;
9use Illuminate\Queue\InteractsWithQueue;
10
11class StartStatJobs implements ShouldQueue
12{
13    use Dispatchable;
14    use InteractsWithQueue;
15    use Queueable;
16
17    /**
18     * Execute the job.
19     *
20     * @return void
21     */
22    public function handle(): void
23    {
24        $brands = Brand::all();
25        foreach ($brands as $brand) {
26            \dispatch(new StatJob($brand))
27                ->delay(rand(0, 90));
28        }
29    }
30}