/** * Execute the command. * * @param BagRepositoryInterface $repository * @param Dispatcher $event */ public function handle(BagRepositoryInterface $repository, Dispatcher $event) { /** * Increment User Coins */ $repository->addCoins($this->user->bag->id, $this->amount); /** * Announce CoinWasPurchased */ $event->fire(new CoinWasPurchased($this->user, $this->amount)); }
/** * Execute the command. * * @param BagRepositoryInterface $repository * @param Dispatcher $event */ public function handle(BagRepositoryInterface $repository, Dispatcher $event) { /** * Refund User */ $repository->addCoins($this->user->bag->id, $this->amount); /** * Announce UserWasRefunded */ $event->fire(new UserWasRefunded($this->user, $this->amount)); }