adrema/app/Module/ModuleSettings.php

48 lines
919 B
PHP
Raw Normal View History

2023-11-16 10:52:57 +01:00
<?php
namespace App\Module;
use App\Setting\Contracts\Storeable;
use App\Setting\LocalSettings;
2024-08-01 11:32:14 +02:00
class ModuleSettings extends LocalSettings implements Storeable
2023-11-16 10:52:57 +01:00
{
/** @var array<int, string> */
public array $modules;
public static function group(): string
{
return 'module';
}
public static function title(): string
{
return 'Module';
}
public static function storeAction(): string
{
return ModuleStoreAction::class;
}
public function hasModule(string $module): bool
{
return in_array($module, $this->modules);
}
2024-08-01 11:17:49 +02:00
/**
* @inheritdoc
*/
public function viewData(): array
{
return [
'data' => [
'data' => [
'modules' => $this->modules,
],
'meta' => ['modules' => Module::forSelect()],
]
];
}
2023-11-16 10:52:57 +01:00
}