Skip to content

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.

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) and Setting::set($key, $value), simplifying data access throughout the system (both in the API and Filament panel).
  • Separation of Concerns: This approach keeps the pages table focused strictly on content, while business logic (e.g., “which page is the homepage”) is kept in a dedicated location.

The system currently supports two key parameters:

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).

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.

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.