Skip to main content
Use classes from Bjanczak\FilamentFlexFields\Support\Components\Schema unless another namespace is given.

FamilySchemaContract

FamilySchemaDefinition

This assumes your family declares maximum. fromArray() rejects unknown keys, textual flags and noninteger versions; export() preserves the defined data shape.

FamilyRenderContext

statePath('rating') produces data.rating. identity($component, $key) derives a stable instance identity. Independent owners need independent keys. Do not keep record/user/tenant/configuration contexts in the process registration metadata.

FamilySchemaAdapter methods

Native Laravel ValidationRule/legacy Rule objects, closures and Stringable rules such as Rule::in() are accepted alongside rule strings. Submission requires value rules; rendering may have an empty list. A schema cannot declare callbacks or load a PHP validation class from client-provided data.

FamilySchemaSubmission::prepare()

Provide submitted values, a list of trusted definitions, the request-local context and an authorizeWrite closure. The policy must return a strict boolean for each resolved definition. This path validates but does not write the database.
Import FamilySchemaSubmission from the schema namespace. $submitted and $canEdit come from your application, after authenticating the user and identifying the record. Persist validated values through your normal transaction and model policy. Definitions are limited to 256 per submission; duplicate state paths reject.

Value contracts and snapshots

FieldValueContract is in Support\Values\Submission. FamilyValueSnapshot($definition, $value) retains detached stored data and its exact schema versions. FamilyValueSnapshotCodec encodes/decodes it. Optional FamilyValueMigration adapters declare supported version pairs and convert stored values explicitly. See saved values, validation and migrations for complete code and preservation of protected state.
Last modified on October 16, 2026