# Configuration Reference

This page covers the host package configuration that a Laravel app may need to set directly. Install-facing setup lives in the [install guide](../getting-started/install.md); this page is for maintainers checking env vars, published config, disks, logs, and panel wiring.

## Publishable Config

Capell host packages publish config by package tag:

```bash
php artisan vendor:publish --tag=capell-core-config
php artisan vendor:publish --tag=capell-admin-config
php artisan vendor:publish --tag=capell-frontend-config
```

Installer and Marketplace config are loaded from their packages. Publish or override them only when the app has a real deployment reason to do so.

## Application Baseline

| Variable           | Default                       | Used for                                                                                             |
| ------------------ | ----------------------------- | ---------------------------------------------------------------------------------------------------- |
| `APP_URL`          | `http://localhost` in Laravel | Default site URL, install prompts, generated callbacks, Marketplace webhook fallback                 |
| `QUEUE_CONNECTION` | `sync` in a fresh Laravel app | Background jobs and package workflows; production installs should normally use `database` or `redis` |
| `LOG_LEVEL`        | Laravel default               | Capell log channel level when the app adds the recommended `capell` channel                          |

## Core Config

Source: `packages/core/config/capell.php`

| Variable                                     | Default                                   | Used for                                                                                            |
| -------------------------------------------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `CAPELL_SITEMAP_MAX_URLS_PER_FILE`           | `50000`                                   | Maximum URLs per generated sitemap file                                                             |
| `CAPELL_SITEMAP_XML_PATH`                    | `/sitemap-xml`                            | Public path used for sitemap index entries                                                          |
| `CAPELL_STATIC_SITE_INTERNAL_REQUESTS`       | `false`                                   | Allows static-site generation to use internal request handling                                      |
| `CAPELL_BLAZE_ENABLED`                       | `BLAZE_ENABLED`, then `true`              | Enables Blaze support where installed                                                               |
| `BLAZE_DEBUG`                                | `false`                                   | Enables Blaze debug behaviour                                                                       |
| `CAPELL_BLAZE_THROW`                         | `false`                                   | Throws during Blaze candidate auditing                                                              |
| `CAPELL_DISABLE_CACHE`                       | `true`                                    | Disables Capell's general cache layer                                                               |
| `CAPELL_DISABLE_CACHE_SAVE_KEYS`             | `[]`                                      | Cache keys or patterns that should not be saved                                                     |
| `CAPELL_WORKSPACES_PRUNE_SCHEDULE`           | `false`                                   | Enables the publishing workspace prune schedule                                                     |
| `CAPELL_WORKSPACES_PRUNE_CRON`               | `15 3 * * *`                              | Cron expression for workspace pruning                                                               |
| `CAPELL_WORKSPACE_PREVIEW_HOME_ROUTE`        | `capell-frontend.home`                    | Route used for workspace home previews                                                              |
| `CAPELL_WORKSPACE_NOTIFICATIONS`             | `true`                                    | Enables workspace state-change notifications                                                        |
| `CAPELL_RELEASE_WINDOWS`                     | `false`                                   | Enforces configured release windows during publishing                                               |
| `CAPELL_RELEASE_WINDOWS_TZ`                  | `UTC`                                     | Timezone used for release windows                                                                   |
| `CAPELL_PLUGINS_SOURCE_URL`                  | `https://plugin.capell.app/packages.json` | Legacy plugin source URL                                                                            |
| `CAPELL_PLUGINS_CACHE_TTL`                   | `3600`                                    | Legacy plugin cache TTL in seconds                                                                  |
| `CAPELL_MEDIA_BACKEND`                       | `spatie`                                  | Media backend resolver key, such as `spatie` or `curator`                                           |
| `CAPELL_SUPER_ADMIN_ROLE`                    | `super_admin`                             | Role name used for the highest admin role                                                           |
| `CAPELL_ADMIN_ROLE`                          | `admin`                                   | Role name used for admin users                                                                      |
| `CAPELL_EDITOR_ROLE`                         | `editor`                                  | Role name used for editor users                                                                     |
| `CAPELL_INSTALL_DEBUG_PACKAGE_SELECTION`     | `false`                                   | Logs installer package-selection mode, prompt defaults, and selected packages for support debugging |
| `CAPELL_DEVELOPER_PAGE`                      | `true`                                    | Shows the developer dashboard page                                                                  |
| `CAPELL_SYSTEM_HEALTH_PAGE`                  | `true`                                    | Shows the system health dashboard page                                                              |
| `CAPELL_DEVELOPER_TOOLS_PHP_WRITES`          | `local_only`                              | Controls developer tooling PHP file writes                                                          |
| `CAPELL_DEVELOPER_TOOLS_DATABASE_WRITES`     | `local_only`                              | Controls developer tooling database writes                                                          |
| `CAPELL_DEVELOPER_TOOLS_READONLY_PREVIEW`    | `true`                                    | Keeps developer tooling previews read-only                                                          |
| `CAPELL_DEVELOPER_TOOLS_EDITOR_URL_TEMPLATE` | _(null)_                                  | Editor URL template for opening local files                                                         |

`CAPELL_DISABLE_CACHE_SAVE_KEYS` accepts exact keys, wildcard patterns, or regex patterns:

```ini
CAPELL_DISABLE_CACHE_SAVE_KEYS=page-*,/^user-\d+$/,my-key
```

Source: `packages/core/config/redirects.php`

| Variable                        | Default | Used for                             |
| ------------------------------- | ------- | ------------------------------------ |
| `CAPELL_REDIRECTS_AUTO_ENABLED` | `true`  | Enables automatic redirect behaviour |

Source: `packages/core/config/audit.php`

| Variable           | Default | Used for                                                   |
| ------------------ | ------- | ---------------------------------------------------------- |
| `AUDITING_ENABLED` | `true`  | Enables auditing support where the audit package is active |

## Admin Config

Source: `packages/admin/config/capell-admin.php`

| Variable                                                        | Default                                | Used for                                                              |
| --------------------------------------------------------------- | -------------------------------------- | --------------------------------------------------------------------- |
| `CAPELL_ADMIN_PATH`                                             | `admin`                                | Filament panel path and admin-owned route prefix                      |
| `CAPELL_ADMIN_DOMAIN`                                           | _(null)_                               | Optional host restriction for admin panel and admin-owned routes      |
| `CAPELL_AUTO_CLEAR_CACHE`                                       | `true`                                 | Clears relevant caches after admin writes                             |
| `CAPELL_AUTO_REFRESH_CACHE`                                     | `false`                                | Refreshes page cache after admin writes where supported               |
| `CAPELL_ADMIN_SECURITY_HEADERS_ENABLED`                         | `true`                                 | Adds admin response security headers                                  |
| `CAPELL_LAYOUT_BUILDER_PREVIEW_MATCH_FRONTEND_CONTAINER_LAYOUT` | `true`                                 | Keeps admin layout previews aligned with frontend container behaviour |
| `CAPELL_UPDATE_DANGER_THRESHOLD`                                | `3`                                    | Version-behind count treated as dangerous in upgrade notices          |
| `CAPELL_UPDATE_API_ENABLED`                                     | `true`                                 | Enables update checks against the Capell update API                   |
| `CAPELL_UPDATE_API_URL`                                         | `https://capell.app/api/updates/check` | Update API endpoint                                                   |
| `CAPELL_UPDATE_API_TIMEOUT_SECONDS`                             | `10`                                   | Update API timeout                                                    |
| `CAPELL_UPDATE_API_ENFORCE_HTTPS`                               | `true`                                 | Requires HTTPS for update API calls                                   |
| `CAPELL_UPDATE_NOTIFICATIONS_ENABLED`                           | `true`                                 | Enables scheduled upgrade summary notifications                       |
| `CAPELL_UPDATE_NOTIFICATION_FREQUENCY`                          | `weekly`                               | Schedule frequency for upgrade summary notifications                  |
| `CAPELL_UPDATE_NOTIFICATION_EMAILS`                             | _(empty)_                              | Comma-separated email recipients for upgrade summaries                |

Use the shared admin entrypoint helper when configuring Filament:

```php
use Capell\Admin\Support\AdminPanelEntrypoint;

return $panel
    ->domain(AdminPanelEntrypoint::domain())
    ->path(AdminPanelEntrypoint::path());
```

See [Admin domain and path](../admin/admin-domain.md) for path-only and subdomain examples.

## Frontend Config

Source: `packages/frontend/config/capell-frontend.php`

| Variable                                | Default    | Used for                                                            |
| --------------------------------------- | ---------- | ------------------------------------------------------------------- |
| `CAPELL_FRONTEND_ASSET_BUILD_TOOL`      | `vite`     | Frontend build integration: `vite`, `mix`, or `static`              |
| `CAPELL_HTML_CACHE`                     | `true`     | Enables static HTML cache reads                                     |
| `CAPELL_WRITE_HTML_CACHE`               | `true`     | Allows static HTML cache writes                                     |
| `CAPELL_MINIFY_HTML`                    | `true`     | Minifies rendered HTML before returning or caching                  |
| `CAPELL_RENDER_HTML_CONTENT_WITH_BLADE` | `false`    | Compatibility escape hatch for trusted developer-authored HTML only |
| `CAPELL_MODEL_EVENT_REGISTRATION_MODE`  | `deferred` | Cache event tracking mode: `sync`, `deferred`, or `async`           |
| `CAPELL_FRONTEND_REGISTER_HOME_ROUTE`   | `false`    | Registers `/` to the Capell frontend controller                     |
| `CAPELL_THROW_ON_NO_SITES`              | `false`    | Throws instead of returning 404 when no sites exist                 |
| `CAPELL_SITE_BASE_URL`                  | _(null)_   | Base URL override for generated site URLs                           |
| `CAPELL_SCHEDULE_PAGE_CLEANER`          | `daily`    | Schedule frequency for page cleanup                                 |
| `CAPELL_DEBUG_LOG`                      | `false`    | Adds frontend resolution debug logging                              |

Keep `CAPELL_RENDER_HTML_CONTENT_WITH_BLADE=false` for editor-controlled CMS content in production. Blade directives execute server-side; this option is only for trusted developer-authored content. See `packages/frontend/docs/security.md`.

## Installer Config

Source: `packages/installer/config/capell-installer.php`

| Variable                        | Default                   | Used for                                                |
| ------------------------------- | ------------------------- | ------------------------------------------------------- |
| `CAPELL_SETUP_ALLOW_REINSTALL`  | `APP_DEBUG`, then `false` | Allows the browser installer to run again after install |
| `CAPELL_SETUP_COMPOSER_BINARY`  | `composer`                | Composer binary used by the browser installer           |
| `CAPELL_SETUP_PHP_BINARY`       | `php`                     | CLI PHP binary used for fresh Artisan processes         |
| `CAPELL_SETUP_DEFAULT_PACKAGES` | `capell-app/filamentors`  | Optional packages preselected in the browser installer  |

Set `CAPELL_SETUP_PHP_BINARY` when the web SAPI sees `PHP_BINARY` as `php-fpm` or another non-CLI executable.

## Marketplace Config

Source: `packages/marketplace/config/capell-marketplace.php`

| Variable                                  | Default                                                    | Used for                                            |
| ----------------------------------------- | ---------------------------------------------------------- | --------------------------------------------------- |
| `CAPELL_MARKETPLACE_ENABLED`              | `true`                                                     | Enables Marketplace integration                     |
| `CAPELL_INSTANCE_ID`                      | _(null)_                                                   | Existing Marketplace instance ID                    |
| `CAPELL_MARKETPLACE_URL`                  | `https://capell.app/api/v1`                                | Marketplace API base URL                            |
| `CAPELL_MARKETPLACE_WEB_URL`              | `https://capell.app`                                       | Public Marketplace web URL                          |
| `CAPELL_MARKETPLACE_CATALOGUE_PAGE_LIMIT` | `3`                                                        | Page limit for catalogue fetches                    |
| `CAPELL_MARKETPLACE_WEBHOOK_URL`          | _(null)_                                                   | Explicit public callback URL for Marketplace events |
| `CAPELL_MARKETPLACE_WEBHOOK_SECRET`       | _(null)_                                                   | Shared secret for Marketplace webhook verification  |
| `CAPELL_MARKETPLACE_TROUBLESHOOTING_URL`  | `https://docs.capell.app/extensions/marketplace-heartbeat` | Help URL shown in Marketplace diagnostics           |

Only override `CAPELL_MARKETPLACE_URL` for staging or self-hosted Marketplace APIs. If Marketplace reports that `api/registration-sessions` cannot be found, the app is probably using an old unversioned API URL.

## Filesystem Disk

The page cache uses a dedicated disk. Add it to `config/filesystems.php` if the installer has not patched it already:

```php
'page_cache' => [
    'driver' => 'local',
    'root' => public_path('page-cache'),
    'throw' => false,
],
```

The web server user must be able to write to this path when `CAPELL_WRITE_HTML_CACHE=true`.

## Logging Channel

Add a dedicated Capell channel to `config/logging.php` if the installer has not patched it already:

```php
'capell' => [
    'driver' => 'single',
    'path' => storage_path('logs/capell.log'),
    'level' => 'debug',
],
```

Frontend logging uses this channel when it exists and falls back to Laravel logging when it does not.

## Morph Map

Register a morph map in the consuming app if polymorphic records may outlive class renames:

```php
use Capell\Core\Models\Language;
use Capell\Core\Models\Page;
use Capell\Core\Models\Site;
use Capell\Core\Models\Blueprint;
use Illuminate\Database\Eloquent\Relations\Relation;

Relation::morphMap([
    'language' => Language::class,
    'page' => Page::class,
    'site' => Site::class,
    'blueprint' => Blueprint::class,
]);
```

## Further Reading

- [Install guide](../getting-started/install.md)
- [Artisan commands](artisan-commands.md)
- [Admin setup](../admin/setup.md)
- [Frontend guide](../frontend/guide.md)
- [Operations troubleshooting](../operations/troubleshooting.md)