Skip to main content
Custom attribute field types can be added to Lunar to control how they are rendered in the panel. To render a form component from an attribute, it must be converted into a Filament form component with a suitable Livewire Synthesizer so it can be hydrated and dehydrated properly.

Create the Field

Create the Field Type

Adding Settings

Additional settings can be added to a field type. For example, the Number field has min and max settings. To define these settings, tell Filament how to render the configuration inputs.
These settings are stored in the configuration JSON column for the attribute and can be accessed when rendering the field in the panel.

Create the Livewire Synthesizer

A Livewire Synthesizer tells Livewire how to hydrate and dehydrate the values provided to the field type during editing. See the Livewire Synthesizers documentation for more details.

Register the Field

The last step is to register the field type with the AttributeData facade, typically in a service provider.