/** * Handle the event. * * @param VoteWasOpened $event * @return void */ public function handle(VoteWasOpened $event) { /** * Queue OpenVoteCommand */ $command = new CloseVotingCommand($event->vote); $delay = $event->vote->close_date->timestamp - $this->carbon->now()->timestamp; $this->queue->laterOn('voting', $delay, $command); }