Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Jobs;
- use App\Models\Tournament;
- use App\Parsers\Services\UpdateTournamentCurrentSeason;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Container\BindingResolutionException;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Bus\Dispatchable;
- use Illuminate\Queue\InteractsWithQueue;
- use Illuminate\Queue\SerializesModels;
- class UpdateTournamentSeason implements ShouldQueue
- {
- use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
- /**
- * The number of times the job may be attempted.
- *
- * @var int
- */
- public $tries = 1;
- /** @var Tournament */
- private $tournament;
- /** @var array */
- private $options;
- /**
- * Create a new job instance.
- *
- * @param Tournament $tournament
- * @param array $options
- */
- public function __construct(Tournament $tournament, array $options = [])
- {
- $this->tournament = $tournament;
- $this->options = $options;
- }
- /**
- * Execute the job.
- *
- * @return void
- * @throws BindingResolutionException
- */
- public function handle()
- {
- $updater = app()->make(UpdateTournamentCurrentSeason::class);
- $updater($this->tournament);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement