Skip to content

SiteSettings ​

Facade: Unusualify\Modularous\Facades\SiteSettings
Accessor: site.settings
Underlying: Modules\Cms\Services\SiteSettingsService

Context-aware router over CMS and System settings. Prefer this facade in public layouts and when code may run in both frontend and panel contexts. Full guide: Settings Services.

ContextBehaviour
Frontend (non-panel HTTP)CmsSettings with fallback to SystemSettings
Backend / panel / consoleSystemSettings only

Methods ​

Context ​

MethodSignatureDescription
forFrontend(): SiteSettingsServiceForce CMS layer + System fallback
forBackend(): SiteSettingsServiceForce System only
forCms(): SiteSettingsServiceAlias of forFrontend()
forSystem(): SiteSettingsServiceAlias of forBackend()
usesCmsLayer(): boolWhether the CMS layer is active
cms(): CmsSettingsServiceUnderlying CMS service
system(): SystemSettingsServiceUnderlying System service

Shared read/write ​

Same signatures as the singular services — see Shared API: get, value, first, all, has, filled, set, forgetCache, snapshot.

On the CMS layer, set writes to CMS only; forgetCache clears both layers.

Usage ​

blade
<img src="{{ SiteSettings::value('site.logo.frontend') }}" alt="{{ SiteSettings::get('site.name') }}">
php
use Unusualify\Modularous\Facades\SiteSettings;

// Auto: frontend → CMS+fallback, panel/console → System
$name = SiteSettings::get('site.name', config('app.name'));

// Explicit
$public = SiteSettings::forFrontend()->get('seo.robots_txt');
SiteSettings::forBackend()->set('seo.robots_txt', $body);

// System-only keys still resolve on frontend via fallback
$gtm = SiteSettings::forFrontend()->get('analytics.gtm_id');
php
public function __construct(
    protected \Modules\Cms\Services\SiteSettingsService $siteSettings,
) {}

Notes ​

  • Analytics snippets: AnalyticsScripts (reads through this router).
  • Empty CMS leaves do not overwrite System values in all() / snapshot().