2023-11-16 10:52:57 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Module;
|
|
|
|
|
2024-08-01 10:25:48 +02:00
|
|
|
use App\Setting\Contracts\Viewable;
|
2023-11-16 10:52:57 +01:00
|
|
|
use App\Setting\Contracts\Storeable;
|
|
|
|
use App\Setting\LocalSettings;
|
|
|
|
|
2024-08-01 10:25:48 +02:00
|
|
|
class ModuleSettings extends LocalSettings implements Viewable, 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 slug(): 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
|
|
|
}
|