Configuration
Unfold CMS uses a layered configuration system. Most settings are managed through the admin panel, with sensible defaults defined in configuration files. This page covers all configuration areas and how they work together.
How Settings Work
Unfold CMS has three layers of configuration:
- Environment variables (
.env) — Server-level settings like database credentials and app key - Config files (
config/site.php) — Default values for all CMS settings - Database settings — User-configured values set through the admin panel
When the CMS reads a setting, it checks the database first. If no value is stored there, it falls back to the config file default. This means:
- Fresh installations use the config file defaults automatically
- Admin panel changes are saved to the database and take priority
- You never need to edit config files unless you want to change defaults before installation
Reading Settings
In PHP/Controllers:
// Using the Setting model (with default value)
$value = Setting::get('comments.enabled', true);
// Using the global helper (recommended)
$value = setting_get('comments.enabled', true);
// Settings automatically fall back to config/site.php defaults
// No need for manual fallback with config()
In Blade Templates:
{{-- Using @setting directive --}}
@setting('comments.enabled', true)
{{-- Using helper function --}}
{{ setting_get('comments.enabled', true) }}
{{-- Conditional rendering --}}
@if(setting_get('comments.enabled'))
<div class="comments-section">
<!-- Comments here -->
</div>
@endif
Available Helper Functions:
| Function | Description | Example |
|---|---|---|
setting_get($key, $default) |
Get a setting value | setting_get('app.name', 'Unfold') |
setting_set($key, $value) |
Set a setting value | setting_set('app.name', 'My Site') |
setting_has($key) |
Check if setting exists | setting_has('app.logo') |
user_setting_get($key, $default) |
Get user-specific setting | user_setting_get('theme', 'light') |
user_setting_set($key, $value) |
Set user-specific setting | user_setting_set('theme', 'dark') |
Environment Configuration
The .env file in your project root contains server-specific settings. Unfold CMS uses standard Laravel environment variables.
Standard Laravel Settings
For detailed information about Laravel's standard environment variables, see the official Laravel documentation:
- Application Configuration -
APP_NAME,APP_ENV,APP_KEY,APP_DEBUG,APP_URL, etc. - Database Configuration -
DB_CONNECTION,DB_HOST,DB_PORT,DB_DATABASE, etc. - Mail Configuration -
MAIL_MAILER,MAIL_HOST,MAIL_PORT,MAIL_FROM_ADDRESS, etc. - Cache Configuration -
CACHE_STORE,REDIS_HOST, etc. - Session Configuration -
SESSION_DRIVER,SESSION_LIFETIME, etc.
CMS-Specific Environment Variables
These variables are unique to Unfold CMS:
| Variable | Description | Default |
|---|---|---|
PRODUCT_TIER |
CMS tier (core, pro, agency) | pro |
LICENSE_API_URL |
License server URL | https://unfoldcms.com/api/license |
QUEUE_CONNECTION |
Must be sync for shared hosting |
sync |
Important: Unfold CMS requires
QUEUE_CONNECTION=syncfor shared hosting compatibility. All tasks execute synchronously — no queue workers are needed.
Warning: Always set
APP_DEBUG=falseandAPP_ENV=productionon live servers. Debug mode exposes sensitive information.
Admin Panel Settings
All CMS settings are managed through the admin panel at /admin/settings. Each tab provides labels, descriptions, and default values. Refer to the admin panel for the complete list of available settings.
Settings are organized into tabs: General, SEO, Permalinks, Blog, Comments, Media, Email, Cache, Maintenance, Authentication, Notifications, Sitemap, Cookie Consent, Contact Form, Security, Social Links, and Template.
Pro-Only Settings
The following settings are available in the Pro and Agency tiers:
| Category | Settings |
|---|---|
| Analytics | Google Analytics 4 tracking ID, property ID, service account, cache duration |
| Newsletter | Enable/disable, double opt-in, list management |
| Backup | Frequency, type, time, retention, storage location |
| Unsplash | API integration for stock photos |
| Support Tickets | Max attachments, file size, auto-close days |
| AI Content | Provider selection, API keys, model configuration, temperature |
| Social Login | Google, GitHub, Facebook OAuth configuration |
Configuration Files
All default settings are defined in config/site.php. This file serves as the single source of truth for default values and is organized into numbered sections matching the admin panel tabs.
For template-specific configuration, see:
- Template Development —
template.jsonandoptions.jsonschemas - Configuration Files Reference — Complete JSON schema reference