private function indexByStatus($status) { $this->validateStatus($status); return Topic::where('status', $status)->active()->get()->map(function ($topic) { return new ApiTopic($topic); }); }