pirepSvc = $pirepSvc; } /** * @param $events */ public function subscribe(Dispatcher $events): void { $events->listen( PirepAccepted::class, 'App\Listeners\BidEvents@onPirepAccept' ); } /** * When a PIREP is accepted, remove any bids * * @param PirepAccepted $event * * @throws \UnexpectedValueException * @throws \InvalidArgumentException * @throws \Exception * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function onPirepAccept(PirepAccepted $event): void { $this->pirepSvc->removeBid($event->pirep); } }