Skip to content
docsv0.34.0

SettingsComponent

The Settings section as a Milpa Component: its state is what the app declared about its panel — the `admin` key of `config/app.php`, key by key, with the source of each value and the gate in effect. Read-only on purpose: writing configuration is a governed operation (`config:set`) and enters through another slice. The browser preferences the renderer paints next to this state (theme, density, a local language override) never reach the server — they are the viewer's, in `localStorage`, and are not state.

SettingsComponent::__construct()

public function __construct(Milpa\Admin\Data\SettingsSource $source):

Parameters

Parameters of __construct()
NameTypeDescription
$sourceMilpa\Admin\Data\SettingsSource

SettingsComponent::contract()

public static function contract(): Milpa\Live\ValueObjects\ComponentContract

The contract: no props, a read-only state, no actions.

SettingsComponent::mount()

public function mount(array $props, Milpa\Live\ValueObjects\ComponentContext $context): Milpa\Live\ValueObjects\StateSnapshot

Mounts with the settings the panel booted with.

Parameters

Parameters of mount()
NameTypeDescription
$propsarray
$contextMilpa\Live\ValueObjects\ComponentContext

SettingsComponent::handle()

public function handle(Milpa\Live\ValueObjects\InteractionRequest $request): Milpa\Live\ValueObjects\InteractionResult

Refuses every action: the section is read-only.

Parameters

Parameters of handle()
NameTypeDescription
$requestMilpa\Live\ValueObjects\InteractionRequest