adrema/app/Setting/SettingServiceProvider.php

45 lines
1.4 KiB
PHP
Raw Normal View History

2022-10-20 02:15:28 +02:00
<?php
namespace App\Setting;
2024-06-27 00:00:29 +02:00
use App\Fileshare\FileshareSettings;
2024-05-27 19:47:28 +02:00
use App\Form\FormSettings;
2023-04-18 22:08:45 +02:00
use App\Invoice\InvoiceSettings;
2023-06-01 15:02:35 +02:00
use App\Mailgateway\MailgatewaySettings;
2023-11-16 10:52:57 +01:00
use App\Module\ModuleSettings;
2024-07-04 21:01:14 +02:00
use App\Prevention\PreventionSettings;
2024-08-01 11:17:49 +02:00
use App\Setting\Actions\ViewAction;
use Illuminate\Routing\Router;
2022-10-20 02:15:28 +02:00
use Illuminate\Support\ServiceProvider;
class SettingServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
app()->singleton(SettingFactory::class, fn () => new SettingFactory());
2024-08-01 11:17:49 +02:00
app(Router::class)->bind('settingGroup', fn ($param) => app(SettingFactory::class)->resolveGroupName($param));
app(Router::class)->middleware(['web', 'auth:web', SettingMiddleware::class])->get('/setting/{settingGroup}', ViewAction::class);
2022-10-20 02:15:28 +02:00
}
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
2023-11-16 10:52:57 +01:00
app(SettingFactory::class)->register(ModuleSettings::class);
2023-04-18 22:08:45 +02:00
app(SettingFactory::class)->register(InvoiceSettings::class);
2023-06-01 15:02:35 +02:00
app(SettingFactory::class)->register(MailgatewaySettings::class);
2023-10-31 00:11:32 +01:00
app(SettingFactory::class)->register(NamiSettings::class);
2024-05-27 19:47:28 +02:00
app(SettingFactory::class)->register(FormSettings::class);
2024-06-27 00:00:29 +02:00
app(SettingFactory::class)->register(FileshareSettings::class);
2024-07-04 21:01:14 +02:00
app(SettingFactory::class)->register(PreventionSettings::class);
2022-10-20 02:15:28 +02:00
}
}