When building a project, displaying different information for different Roles is essential. We would not want our Employees to see Critical information without specific access, so that is where we can conditionally hide/show fields and columns based on authorization level.
Sometimes, we have to limit the number of entries we can select. For example, your Employee can only work on one Client at a time.
Filament allows us to create Select fields quickly, but they can be hard to read or find specific information. Especially if your records are grouped by a relationship. This example will show how to quickly group your Select options by a Relationship (or anything else).
When dealing with confirmation modals - it is important to customize the message. You can do that with a callback when using Filament Actions.
If you need to create a pre-set number of default values, you can use Filament Repeater to do just that! By preventing users from adding or removing values, you have complete control over the data.
You can add a custom BulkAction to the table, building a file from the selected table rows and download it immediately.
If you have a ToggleColumn in the table and want to ensure there's only ONE row in the database with true value, you can auto-set others to false.
true
false
If you want to set the text input value based on the changed Select option, you can do it with afterStateUpdated() and $set.
afterStateUpdated()
$set
If you have multiple panels, like /admin/login and /student/login URLs, you may want to customize how their login forms look. In this example, we will customize the Heading text.
/admin/login
/student/login
By default, Filament pagination leaves the page on the same scrolling position after clicking to another page. So users need to scroll up manually. This snippet will prevent that scroll.