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
'middleware' => ['web'],
'storage' => [
'disk' => env('FILESYSTEM_DRIVER', 'public'),
],
'profile_photo_disk' => 'public',
'default_img_upload_disk' => 'public',
'default_img_download_disk' => 'public',
'prefix' => '',| Key | Description |
|---|---|
middleware | Middleware group applied to Kompass routes. |
storage.disk | Filesystem disk used for media storage. |
*_disk | Disks for profile photos and image upload/download. |
prefix | Optional path prefix for stored assets. |
Authentication
'auth' => [
'password_login_enabled' => true,
'force_passkey_on_first_login' => false,
],| Key | Description |
|---|---|
password_login_enabled | Allow classic email + password login. Set to false for passkey-only. |
force_passkey_on_first_login | Require 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:
'features' => [
Features::profilePhotos(),
Features::accountDeletion(),
Features::activityLog(),
],| Feature | Effect |
|---|---|
profilePhotos() | Lets users upload a profile photo. |
accountDeletion() | Exposes self-service account deletion. |
activityLog() | Enables Activity Logging. |
Localization
'available_locales' => ['de', 'en', 'bg', 'cs', /* … */],
'dateformat' => 'd.m.Y H:i',| Key | Description |
|---|---|
available_locales | Languages offered in the multilingual frontend and admin. |
dateformat | PHP 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.
'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],| Key | Description |
|---|---|
generate_blur_placeholder | Generate a blurred LQIP placeholder per image. |
quality | Per-format output quality for AVIF / WebP / JPEG. |
sizes | Named responsive variants (width, height, fit method, quality). |
fallback | Cap 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.
'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:
| Key | Description |
|---|---|
label | Name shown in the palette and builder. |
icon | Tabler icon name. |
component | Frontend Blade component (blocks.<type> → components/blocks/<type>.blade.php). |
container | true if the block nests child blocks (e.g. Group, Accordion). |
default_fields | Fields auto-created when the block is added. |
styling | Builder accent classes — rail, badge, bar, accent. |
controls | Which edit controls appear (see below). |
palette | false hides the block from the add-block palette. |
palette_image / palette_image_class / palette_border | Palette 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:
$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):
| Type | Label | Container | In palette |
|---|---|---|---|
wysiwyg | Textblock | – | yes |
group | Layout Block | yes | yes |
accordiongroup | Accordion | yes | yes |
button | Button | – | yes |
video | Video | – | yes |
gallery | Media | – | yes |
anchormenu | Anchor menu | – | no |
relationship | Relationship | – | yes |
Query Sources
'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:
'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:
| Key | Required | Description |
|---|---|---|
label | yes | Human label shown in the field-type picker. |
icon | yes | Tabler icon for the picker. |
display_component | yes | Anonymous Blade component (components/block/*) that renders the value on the frontend. |
edit_widget | yes | The admin editing widget: input, editor, image, gallery, or oembed. |
select | no | Set to false to hide the type from the manual field-type picker (e.g. oembed). |
The nine built-in types:
| Type | Edit widget | Use for |
|---|---|---|
text | input | Single-line / short text |
wysiwyg | editor | Rich text via the Kompass Editor |
image | image | A single Media Library image |
gallery | gallery | Multiple images |
link | input | A URL |
true_false | input | A boolean toggle |
file | input | A file / download |
color | input | A color value (uses the picker below) |
oembed | oembed | An 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):
'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:
| Value | Meaning |
|---|---|
'' (empty) | No colour set (only when allowEmpty is on) |
#rrggbb | An opaque colour |
#rrggbbaa | A 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:
{{-- 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:
<x-kompass::color-picker name="brand_color" value="#FF6008" />Props
| Prop | Default | Description |
|---|---|---|
value | '' | Current colour (#rrggbb, #rrggbbaa, or empty). |
swatches | config palette | Override the preset palette for this instance. |
allowEmpty | true | Show the clear control and allow an empty value. |
name | null | Render a hidden <input name> for plain form posts. |
placeholder | #rrggbb | Placeholder for the hex field. |
Default palette
color_picker.swatches is the default preset palette:
'color_picker' => [
'swatches' => [
'#ef4444', '#f97316', '#eab308', '#22c55e', '#14b8a6',
'#3b82f6', '#6366f1', '#a855f7', '#ec4899', '#111827',
],
],Override it per instance via the swatches prop:
<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.