Skip to main content

Theme Configuration

You can add configuration to your theme by creating a config.blade.php file in the resources/themes/theme_name/config/ folder of your installation.

@include('shared.text', ['name' => 'config_1', 'label' => 'Configuration 1', 'value' => ''])

Configuration Validation

You can validate the configuration by creating a rules.php file in the resources/themes/theme_name/config/ folder of your installation.

<?php
return [
'config_1' => 'required|string',
];

You can check the Laravel documentation for more information on validation.

Configuration Storage

The theme configuration is stored in a config.json file in the resources/themes/theme_name/config/ folder of your installation.

{
"config_1": "value"
}

You can also define default values in the config.json file of your theme.

{
"config_1": "value",
"config_2": "value"
}

To retrieve the configuration in your theme, you can use the theme_config method.

{{ theme_config('config_1') }}
Translatable Configuration

If you need some configuration fields to support multiple languages, you can store them in the database instead of config.json. See Database Settings for details.