2 years ago
Out of the box, Filament provides a tonne of components that you can use in your application. Let's look at how I built a DescriptionList component for one of my own projects. class DescriptionList extends Component { protected string $view = 'filament.forms.components.description-list'; protected array | Closure $items = []; public function items(array | Closure $items): static { $this->items = $items; return $this; }} protected function getFormSchema(): array { return [ DescriptionList::make('overview') ->items(function (Model $record, Closure $get) { $items = [ 'Name' => $record->name, 'Email' => $record->email, ]; if (!! class DescriptionList extends Component { public function getItems(): array { return $this->evaluate($this->items); }}