execute(fn () => $service->listing('agent', (int) $this->currentAgent()->id, request()->all())); } public function detail(SiteInboxService $service) { return $this->execute(fn () => $service->detail('agent', (int) $this->currentAgent()->id, $this->id())); } public function unread(SiteInboxService $service) { return $this->execute(fn () => $service->unread('agent', (int) $this->currentAgent()->id)); } public function read(SiteInboxService $service) { return $this->execute(fn () => $service->read('agent', (int) $this->currentAgent()->id, $this->id())); } private function id(): int { return (int) request()->validate(['id' => ['required', 'integer', 'min:1']])['id']; } }