39 lines
990 B
PHP
39 lines
990 B
PHP
<?php
|
|
|
|
namespace App\Setting;
|
|
|
|
use Modules\Module\ModuleSettings;
|
|
use App\Setting\Data\SettingSynthesizer;
|
|
use Illuminate\Routing\Router;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Livewire\Livewire;
|
|
use Modules\Invoice\InvoiceSettings;
|
|
|
|
class SettingServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
app()->singleton(SettingFactory::class, fn () => new SettingFactory());
|
|
app(Router::class)->bind('settingGroup', fn ($param) => app(SettingFactory::class)->resolveGroupName($param));
|
|
}
|
|
|
|
/**
|
|
* Bootstrap services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
app(SettingFactory::class)->register(ModuleSettings::class);
|
|
app(SettingFactory::class)->register(InvoiceSettings::class);
|
|
app(SettingFactory::class)->register(NamiSettings::class);
|
|
|
|
Livewire::propertySynthesizer(SettingSynthesizer::class);
|
|
}
|
|
}
|