Skip to content

Configuration File

config/kompass.php is the central place to tune how Kompass behaves. The installer publishes it automatically (see Installation), and it's never force-overwritten on updates, so your edits are safe.

Re-publish if needed

Deleted the file? Regenerate it with php artisan vendor:publish --tag=config.

Routing & Storage

php
'middleware' => ['web'],

'storage' => [
    'disk' => env('FILESYSTEM_DRIVER', 'public'),
],

'profile_photo_disk' => 'public',
'default_img_upload_disk' => 'public',
'default_img_download_disk' => 'public',
'prefix' => '',
KeyDescription
middlewareMiddleware group applied to Kompass routes.
storage.diskFilesystem disk used for media storage.
*_diskDisks for profile photos and image upload/download.
prefixOptional path prefix for stored assets.

Authentication

php
'auth' => [
    'password_login_enabled' => true,
    'force_passkey_on_first_login' => false,
],
KeyDescription
password_login_enabledAllow classic email + password login. Set to false for passkey-only.
force_passkey_on_first_loginRequire users to register a passkey on first sign-in.

See Passkey Authentication for the full passwordless setup.

Features

Optional features, toggled by including or removing them from the array:

php
'features' => [
    Features::profilePhotos(),
    Features::accountDeletion(),
    Features::activityLog(),
],
FeatureEffect
profilePhotos()Lets users upload a profile photo.
accountDeletion()Exposes self-service account deletion.
activityLog()Enables Activity Logging.

Localization

php
'available_locales' => ['de', 'en', 'bg', 'cs', /* … */],
'dateformat' => 'd.m.Y H:i',
KeyDescription
available_localesLanguages offered in the multilingual frontend and admin.
dateformatPHP date format used across the admin.

Image Processing

Powered by Intervention Image v3. Controls conversion quality, the responsive size presets, and a fallback for full-size images.

php
'driver' => Driver::class,
'generate_blur_placeholder' => true,

'quality' => [
    'avif' => 50,
    'webp' => 80,
    'jpeg' => 85,
],

'sizes' => [
    'thumbnail'   => ['width' => 520,  'height' => null, 'method' => 'scale',     'quality' => 60],
    'blog_single' => ['width' => 1200, 'height' => null, 'method' => 'scale',     'quality' => 80],
    'landscape'   => ['width' => 1280, 'height' => 720,  'method' => 'cover',     'quality' => 75],
],

'fallback' => ['width' => 2500, 'height' => 2500, 'method' => 'scaleDown', 'quality' => 85],
KeyDescription
generate_blur_placeholderGenerate a blurred LQIP placeholder per image.
qualityPer-format output quality for AVIF / WebP / JPEG.
sizesNamed responsive variants (width, height, fit method, quality).
fallbackCap applied to the original when no preset matches.

See Manage Media Assets for usage on the frontend.

Block Types

block_types is the single source of truth for the built-in blocks. Each entry feeds the add-block palette, the default fields created when a block is added, the builder styling, the edit-control list, and the frontend component name. User-defined Blocktemplates rows are merged in at runtime — built-ins win on a type collision.

php
'wysiwyg' => [
    'label'          => 'Textblock',
    'icon'           => 'blockquote',
    'component'      => 'blocks.wysiwyg',          // frontend Blade component
    'container'      => false,                     // can it hold child blocks?
    'default_fields' => [['type' => 'wysiwyg', 'order' => 1]],
    'styling'        => $styleSlate,               // builder accent colors
    'controls'       => ['layout', 'alignment', 'link', 'color', 'advanced'],
    'palette'        => true,                      // show in the add-block palette
    'palette_image'  => 'icons-blocks/default.png',
    'palette_border' => 'border-blue-600',
],

Entry keys:

KeyDescription
labelName shown in the palette and builder.
iconTabler icon name.
componentFrontend Blade component (blocks.<type>components/blocks/<type>.blade.php).
containertrue if the block nests child blocks (e.g. Group, Accordion).
default_fieldsFields auto-created when the block is added.
stylingBuilder accent classes — rail, badge, bar, accent.
controlsWhich edit controls appear (see below).
palettefalse hides the block from the add-block palette.
palette_image / palette_image_class / palette_borderPalette thumbnail and styling.

Control keys map to the anonymous Blade components under resources/views/components/block-controls/*:

layout · layout-grid · container-layout · alignment · link · color · gallery · advanced

Reusable presets

The config defines shorthands at the top of the file:

php
$styleSlate        = ['rail' => 'border-l-slate-400', 'badge' => 'bg-slate-500', /* … */];
$controlsBasic     = ['layout', 'color', 'advanced'];
$controlsContainer = ['container-layout', 'layout-grid', 'color', 'advanced'];

The built-in blocks (see Block Types for usage):

TypeLabelContainerIn palette
wysiwygTextblockyes
groupLayout Blockyesyes
accordiongroupAccordionyesyes
buttonButtonyes
videoVideoyes
galleryMediayes
anchormenuAnchor menuno
relationshipRelationshipyes

Query Sources

php
'query_source_models' => [
    'pages' => \Secondnetwork\Kompass\Models\Page::class,
    'posts' => \Secondnetwork\Kompass\Models\Post::class,
],

Models allow-listed for the Relationship Block. Sources themselves are database-managed (the query_sources table, edited under Admin → Query sources); query_models() merges those rows with any literal entries here — config wins on a key collision.

Allow-list models explicitly

Only models listed in query_source_models can ever be queried by the Relationship block. Add your own models here before registering a query source.

Field Types

field_types defines the editable fields a block can hold. Each entry maps a type key to its label, palette icon, the frontend display component, and the admin edit widget:

php
'field_types' => [
    'text'       => ['label' => 'Text',          'icon' => 'tabler-letter-case',     'display_component' => 'block.text',          'edit_widget' => 'input'],
    'wysiwyg'    => ['label' => 'WYSIWYG Editor', 'icon' => 'tabler-blockquote',      'display_component' => 'block.wysiwyg',       'edit_widget' => 'editor'],
    'image'      => ['label' => 'Image',          'icon' => 'tabler-photo',           'display_component' => 'block.image',         'edit_widget' => 'image'],
    'gallery'    => ['label' => 'Gallery',        'icon' => 'tabler-layout-grid-add', 'display_component' => 'block.gallery-field', 'edit_widget' => 'gallery'],
    'link'       => ['label' => 'Link',           'icon' => 'tabler-link',            'display_component' => 'block.link',          'edit_widget' => 'input'],
    'true_false' => ['label' => 'true/false',     'icon' => 'tabler-toggle-left',     'display_component' => 'block.true_false',    'edit_widget' => 'input'],
    'file'       => ['label' => 'File',           'icon' => 'tabler-file-zip',        'display_component' => 'block.file',          'edit_widget' => 'input'],
    'color'      => ['label' => 'Color',          'icon' => 'tabler-palette',         'display_component' => 'block.color',         'edit_widget' => 'input'],
    'oembed'     => ['label' => 'Video embed',    'icon' => 'tabler-brand-youtube',   'display_component' => 'block.text',          'edit_widget' => 'oembed', 'select' => false],
],

Each entry accepts these keys:

KeyRequiredDescription
labelyesHuman label shown in the field-type picker.
iconyesTabler icon for the picker.
display_componentyesAnonymous Blade component (components/block/*) that renders the value on the frontend.
edit_widgetyesThe admin editing widget: input, editor, image, gallery, or oembed.
selectnoSet to false to hide the type from the manual field-type picker (e.g. oembed).

The nine built-in types:

TypeEdit widgetUse for
textinputSingle-line / short text
wysiwygeditorRich text via the Kompass Editor
imageimageA single Media Library image
gallerygalleryMultiple images
linkinputA URL
true_falseinputA boolean toggle
fileinputA file / download
colorinputA color value (uses the picker below)
oembedoembedAn embeddable video URL (YouTube, Vimeo)

Add your own field type

Append an entry with a matching display_component under resources/views/components/block/ and an edit_widget. It then appears in the block field picker.

Setting Field Types

The global Settings panel uses a separate vocabulary (setting_field_types), because its ids drive a different render switch (e.g. switch instead of true_false):

php
'setting_field_types' => [
    'text'    => ['label' => 'Text',          'icon' => 'tabler-letter-case'],
    'wysiwyg' => ['label' => 'WYSIWYG Editor', 'icon' => 'tabler-blockquote'],
    'image'   => ['label' => 'Image',          'icon' => 'tabler-photo'],
    'link'    => ['label' => 'Link',           'icon' => 'tabler-link'],
    'switch'  => ['label' => 'true or false',  'icon' => 'tabler-toggle-left'],
    'file'    => ['label' => 'File',           'icon' => 'tabler-file-zip'],
    'color'   => ['label' => 'Color',          'icon' => 'tabler-palette'],
],

Color Picker

<x-kompass::color-picker> is the single, reusable colour input used everywhere in the backend — the block color field, a block's own colour, the theme colours, the favicon theme-colour, the background overlay, and the color setting type.

It offers a hue slider, an alpha (opacity) slider, an empty state (No color), hex entry (#rgb / #rrggbb / #rrggbbaa), the preset palette, and a checkerboard preview for transparency.

Value format

The component reads and emits one of three shapes:

ValueMeaning
'' (empty)No colour set (only when allowEmpty is on)
#rrggbbAn opaque colour
#rrggbbaaA colour with alpha (transparency from the opacity slider)

Emitting changes

The picker dispatches a bubbling changed event carrying the new value; the parent decides what to do with it — typically writing it back to a Livewire property:

blade
{{-- block field --}}
<x-kompass::color-picker
    :value="$valuedata"
    @changed="$wire.updateDatafield({{ $field->id }}, $event.detail)"
/>

{{-- a block's own colour --}}
<x-kompass::color-picker
    :value="$itemblocks->getMeta('color')"
    @changed="$wire.saveset({{ $itemblocks->id }}, 'color', $event.detail)"
/>

For a plain (non-Livewire) form, pass name to render a hidden input that posts the value:

blade
<x-kompass::color-picker name="brand_color" value="#FF6008" />

Props

PropDefaultDescription
value''Current colour (#rrggbb, #rrggbbaa, or empty).
swatchesconfig paletteOverride the preset palette for this instance.
allowEmptytrueShow the clear control and allow an empty value.
namenullRender a hidden <input name> for plain form posts.
placeholder#rrggbbPlaceholder for the hex field.

Default palette

color_picker.swatches is the default preset palette:

php
'color_picker' => [
    'swatches' => [
        '#ef4444', '#f97316', '#eab308', '#22c55e', '#14b8a6',
        '#3b82f6', '#6366f1', '#a855f7', '#ec4899', '#111827',
    ],
],

Override it per instance via the swatches prop:

blade
<x-kompass::color-picker
    :value="$color"
    :swatches="['#FF6008', '#111827', '#ffffff']"
    @changed="$wire.set('color', $event.detail)"
/>

Alpha replaces separate opacity controls

Because the picker carries alpha in the value (#rrggbbaa), features that used a separate opacity slider — e.g. the background image overlay — now control transparency through the colour itself.

Released under the MIT License.