Files
laravel-manager-packagist/src/Modules/Settings/SettingsModule.php
T
2026-12-04 18:41:33 +00:00

59 lines
1.7 KiB
PHP

<?php
namespace IriksIT\Manager\Modules\Settings;
use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Names;
use IriksIT\Manager\Support\Permission;
/**
* The settings screen: which parts and features are on, and the keys and addresses of integrations, all changeable from the
* manager by an account with the right, in the whole face of the manager only. A change is saved (secrets encrypted) and works at
* once; see Support\Settings.
*/
class SettingsModule extends BaseModule
{
public function key(): string
{
return 'settings';
}
public function label(): string
{
return 'Settings';
}
public function enabledByDefault(): bool
{
return true;
}
public function tables(): array
{
return ['settings'];
}
public function permissions(): array
{
return [
new Permission('settings.manage', 'Switch parts and features on or off and change settings', 'Settings'),
new Permission('settings.secrets', 'Change keys, passwords and addresses of integrations', 'Settings', needs: ['settings.manage']),
];
}
public function navigation(): array
{
return [['label' => 'Settings', 'section' => 'Administration', 'route' => Names::route('settings.index'), 'permission' => 'settings.manage', 'icon' => 'cog', 'simple' => false]];
}
public function actions(): array
{
return ['settings.update' => ['Changed the settings'], 'settings.refresh' => ['Refreshed the settings'], 'settings.check' => ['Tried a connection of the settings']];
}
public function views(): array
{
return ['settings.index' => 'Opened the settings'];
}
}