Advertisement
Guest User

Untitled

a guest
Aug 27th, 2020
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.29 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. namespace App\Jobs;
  5.  
  6.  
  7. use App\Models\Tournament;
  8. use App\Parsers\Services\UpdateTournamentCurrentSeason;
  9. use Illuminate\Bus\Queueable;
  10. use Illuminate\Contracts\Container\BindingResolutionException;
  11. use Illuminate\Contracts\Queue\ShouldQueue;
  12. use Illuminate\Foundation\Bus\Dispatchable;
  13. use Illuminate\Queue\InteractsWithQueue;
  14. use Illuminate\Queue\SerializesModels;
  15.  
  16. class UpdateTournamentSeason implements ShouldQueue
  17. {
  18.     use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
  19.  
  20.     /**
  21.      * The number of times the job may be attempted.
  22.      *
  23.      * @var int
  24.      */
  25.     public $tries = 1;
  26.  
  27.     /** @var Tournament */
  28.     private $tournament;
  29.  
  30.     /** @var array */
  31.     private $options;
  32.  
  33.     /**
  34.      * Create a new job instance.
  35.      *
  36.      * @param Tournament $tournament
  37.      * @param array $options
  38.      */
  39.     public function __construct(Tournament $tournament, array $options = [])
  40.     {
  41.         $this->tournament = $tournament;
  42.         $this->options = $options;
  43.     }
  44.  
  45.     /**
  46.      * Execute the job.
  47.      *
  48.      * @return void
  49.      * @throws BindingResolutionException
  50.      */
  51.     public function handle()
  52.     {
  53.         $updater = app()->make(UpdateTournamentCurrentSeason::class);
  54.         $updater($this->tournament);
  55.     }
  56. }
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement