Building a custom color palette field in Filament - Part 1 To accept an array of options on the field, we need to declare a new method on the class.

protected array $options = []; public function options(array $options): static { $this->options = $options; return $this; }}

Let's add a getOptions() method to the field that returns the array of options given to the field.

In it's current state, the ColorPalette field can only accept a static array of color options.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners