Skip to content

CmsSettings ​

Facade: Unusualify\Modularous\Facades\CmsSettings
Accessor: cms.settings
Underlying: Modules\Cms\Services\CmsSettingsService
Model: Modules\Cms\Entities\SiteSetting (IsSingular)

Frontend/CMS-facing settings singleton. No System fallback — use SiteSettings when empty CMS keys should fall through to System. Full guide: Settings Services.

Sections ​

site, social, contact, seo only.

smtp, analytics, and locale are not editable on SiteSetting — use SystemSettings.

Methods ​

Shared singular API — see Shared API.

MethodSignatureDescription
get / value(string $key, mixed $default = null, ?string $locale = null): mixedDot-path read with locale / media-leaf expansion
first(string $key, mixed $default = null, ?string $locale = null): mixedFirst list element when applicable
all(?string $locale = null): arrayLocale-resolved section tree
has(string $key): boolKey exists in snapshot
filled(string $key, ?string $locale = null): boolResolved value is non-empty
set(string $key, mixed $value): voidPersist + forget cache
forgetCache(): voidClear cached snapshot
snapshot(): arrayRaw cached sections

Usage ​

php
use Unusualify\Modularous\Facades\CmsSettings;

CmsSettings::set('site.name', 'Public site name');
$tagline = CmsSettings::get('site.tagline');

if (! CmsSettings::filled('seo.default_meta_title')) {
    // CMS empty — SiteSettings::forFrontend() would fall back to System
}

Notes ​