Overview

Widgets
Watch the Rapid Laravel Development with Filament series on Laracasts - it will teach you the basics of adding widgets to Filament resources.Creating a resource widget
To get started building a resource widget:app/Filament/Resources/CustomerResource/Widgets directory, and a view in the resources/views/filament/resources/customer-resource/widgets directory.
You must register the new widget in your resource’s getWidgets() method:
Displaying a widget on a resource page
To display a widget on a resource page, use thegetHeaderWidgets() or getFooterWidgets() methods for that page:
getHeaderWidgets() returns an array of widgets to display above the page content, whereas getFooterWidgets() are displayed below.
If you’d like to customize the number of grid columns used to arrange widgets, check out the Pages documentation.
Accessing the current record in the widget
If you’re using a widget on an Edit or View page, you may access the current record by defining a$record property on the widget class:
Accessing page table data in the widget
If you’re using a widget on a List page, you may access the table data by first adding theExposesTableToWidgets trait to the page class:
InteractsWithPageTable trait, and return the name of the page class from the getTablePage() method:
$this->getPageTableQuery() method:
$this->getPageTableRecords() method:
Passing properties to widgets on resource pages
When registering a widget on a resource page, you can use themake() method to pass an array of Livewire properties to it:
status in the widget class using $this->status.