You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

28 lines
952 B

<?php
namespace App\Domains\System\Providers;
use App\Domains\System\Enums\SystemSettingKey;
use App\Domains\System\Queries\GetSystemSettings;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
class ViewServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot(GetSystemSettings $getSystemSettings): void
{
/**
* Register a view composer for presentation glue.
*
* This binds data to specific layout assets (e.g., sidebar) using
* a decoupled query pattern, keeping the domain's root provider pristine.
*/
View::composer(['components.layouts.*'], function ($view) use ($getSystemSettings) {
$view->with('logo', $getSystemSettings->get(SystemSettingKey::WEB_LOGO));
$view->with('favicon', $getSystemSettings->get(SystemSettingKey::WEB_FAVICON));
});
}
}