play(fn () => app(ShowQuests::class)(auth()->user(), (int) request('village_id'))); } public function claim() { return $this->play(fn () => $this->answer(app(ClaimQuest::class)(auth()->user(), (int) request('village_id'), (string) request('quest')))); } public function collect() { $ids = request()->has('ids') ? array_map('intval', (array) request('ids')) : null; return $this->play(fn () => $this->answer(app(CollectRewards::class)(auth()->user(), (int) request('village_id'), $ids))); } private function answer(Village $village): array { return [ 'book' => app(ShowQuests::class)(auth()->user(), $village->id), 'village' => VillagePresenter::present($village, now()->toImmutable()), ]; } }