Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| StartStatJobs | n/a |
0 / 0 |
n/a |
0 / 0 |
2 | n/a |
0 / 0 |
|||
| handle | n/a |
0 / 0 |
2 | n/a |
0 / 0 |
|||||
| 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 | /** |
| 12 | * @codeCoverageIgnore |
| 13 | */ |
| 14 | class StartStatJobs implements ShouldQueue |
| 15 | { |
| 16 | use Dispatchable; |
| 17 | use InteractsWithQueue; |
| 18 | use Queueable; |
| 19 | |
| 20 | /** |
| 21 | * Execute the job. |
| 22 | * |
| 23 | * @return void |
| 24 | */ |
| 25 | public function handle() |
| 26 | { |
| 27 | $brands = Brand::all(); |
| 28 | foreach ($brands as $brand) { |
| 29 | \dispatch(new StatJob($brand)) |
| 30 | ->delay(rand(0, 90)); |
| 31 | } |
| 32 | } |
| 33 | } |