webx-ui / module-settings
Site settings for the WebX UI admin panel: a screen described as JSON, patched by the project, saved by description.
Requires
- php: ^8.3
- illuminate/contracts: ^13.0
- illuminate/database: ^13.0
- illuminate/http: ^13.0
- illuminate/routing: ^13.0
- illuminate/support: ^13.0
- illuminate/validation: ^13.0
- webx-ui/localization: ^0.18.0
- webx-ui/mcp: ^0.18.0
- webx-ui/module-admin: ^0.18.0
- webx-ui/module-auth: ^0.18.0
Requires (Dev)
- orchestra/testbench: ^11.0
- phpunit/phpunit: ^12.0 || ^13.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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.