Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| StartStatJobs | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| handle | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Jobs; |
| 4 | |
| 5 | use App\Models\Brand; |
| 6 | use Illuminate\Bus\Queueable; |
| 7 | use Illuminate\Contracts\Queue\ShouldQueue; |
| 8 | use Illuminate\Foundation\Bus\Dispatchable; |
| 9 | use Illuminate\Queue\InteractsWithQueue; |
| 10 | |
| 11 | class 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 | } |