statuses !== null) { return $this->statuses; } $this->statuses = []; foreach (Module::all() as $module) { $this->statuses[$module->getName()] = $module->isEnabled(); } return $this->statuses; } public function isEnabled(string $moduleKey): bool { return (bool) ($this->all()[$moduleKey] ?? false); } }