Search by

webx-ui / module-settings

Ahabzig

Site settings for the WebX UI admin panel: a screen described as JSON, patched by the project, saved by description.

Package info

github.com/webx-ui/module-settings

Homepage

Issues

pkg:composer/webx-ui/module-settings

Statistics

Installs: 44

Dependents: 1

Suggesters: 0

Stars: 0

v0.18.0 2026-09-16 17:14 UTC

This package is auto-updated.

Last update: 2026-09-16 17:16:09 UTC


README

Site settings as a section of the WebX UI admin panel. The screen is a JSON tree the package ships; the project lays its own tabs and fields over it with a patch, and saving goes by the same description — a key the tree does not name is not written.

Requirements

  • PHP 8.3+, Laravel 13
  • webx-ui/module-admin, webx-ui/module-auth (the panel and the sign-in), webx-ui/mcp

Install

composer require webx-ui/module-settings
php artisan migrate

The section appears once the front end lists it too: settings() from @webx-ui/module-settings in createAdmin({ modules: [...] }). Permissions: settings.view, settings.manage.

The screen

settings.index, one tab out of the box:

id type name
tabs wx-tabs
general wx-tab
general-card wx-card
project-name wx-input general.project-name

Those ids are the public contract: a project addresses them from its patch. Add what the site needs from a service provider that boots after this one — the application's own does:

use WebxUi\Admin\Facades\Screens;

Screens::extend('settings.index', resource_path('screens/settings.json'));
[
  {
    "op": "add",
    "target": "tabs",
    "node": {
      "id": "seo",
      "type": "wx-tab",
      "label": "SEO",
      "children": [
        {
          "id": "seo-card",
          "type": "wx-card",
          "children": [
            {
              "id": "robots",
              "type": "wx-textarea",
              "name": "seo.robots-txt",
              "label": "robots.txt"
            }
          ]
        }
      ]
    }
  }
]

A field added by a patch is a field the server accepts: validated with the rules its type declares, per language when localized, stored under its name.

Reading a setting

settings('general.project-name');          // the current language, with the site's fallbacks
settings('seo.robots-txt', 'User-agent: *');
settings()->all();                          // everything the screen describes, resolved

Values are cached whole and the cache is dropped on save; WebxUi\Settings\Events\SettingsSaved carries the keys that changed.

MCP

settings_list, settings_get, settings_set (mutating, honours dry_run) — the keys and the rules come from the screen, so an agent can change exactly what an administrator can.

Languages

en, ru, uk, de, pl, fr, es, it, pt, tr. Only English, Russian and Ukrainian have been read by a speaker.

Licence

MIT.