Source: ryangjchandler.co.uk

Building a custom Filament view component
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); }}
Newsletter

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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners