Global Settings
The Global Settings module manages parameters that affect the behavior of the entire website. Instead of storing these in static .env configuration files, Pyxis CMS uses the database, allowing administrators to make dynamic changes without developer intervention.
Key-Value Architecture
Section titled “Key-Value Architecture”The system utilizes a simple yet powerful key-value structure within the settings table. Each record consists of a unique key and its corresponding value.
- Setting Model: Features static helper methods
Setting::get($key)andSetting::set($key, $value), simplifying data access throughout the system (both in the API and Filament panel). - Separation of Concerns: This approach keeps the
pagestable focused strictly on content, while business logic (e.g., “which page is the homepage”) is kept in a dedicated location.
Available Settings
Section titled “Available Settings”The system currently supports two key parameters:
1. Site Language (site_language)
Section titled “1. Site Language (site_language)”Defines the default language for the frontend and interface. Next.js can fetch this value to automatically set HTML lang headers or determine date formatting.
- Available options: Polish (PL), English (EN).
2. Homepage Selection (homepage_id)
Section titled “2. Homepage Selection (homepage_id)”A critical setting for Headless routing. Instead of relying on a hardcoded slug (like /home), the API queries the settings table for the UUID of the page that should be served at the root / address.
Administration Panel
Section titled “Administration Panel”Management is handled via a dedicated settings page in the Filament panel (ManageSettings).
- Reactivity: Upon changing the homepage, the system automatically updates the routing, which is immediately reflected in the Next.js frontend.
- Security: The form uses the
statePath('data')method, enabling secure validation and bulk saving of variables.