Overview
Filament’s infolists can use Actions. They are buttons that can be added to any infolist component. Also, you can render anonymous sets of actions on their own, that are not attached to a particular infolist component.Defining a infolist component action
Action objects inside an infolist component are instances ofFilament/Infolists/Components/Actions/Action. You must pass a unique name to the action’s make() method, which is used to identify it amongst others internally within Filament. You can customize the trigger button of an action, and even open a modal with little effort:
Adding an affix action to a entry
Certain entries support “affix actions”, which are buttons that can be placed before or after its content. The following entries support affix actions: To define an affix action, you can pass it to eitherprefixAction() or suffixAction():
Passing multiple affix actions to a entry
You may pass multiple affix actions to an entry by passing them in an array to eitherprefixActions() or suffixActions(). Either method can be used, or both at once, Filament will render all the registered actions in order:
Adding a hint action to an entry
All entries support “hint actions”, which are rendered aside the entry’s hint. To add a hint action to a entry, you may pass it tohintAction():
Passing multiple hint actions to a entry
You may pass multiple hint actions to a entry by passing them in an array tohintActions(). Filament will render all the registered actions in order:
Adding an action to a custom infolist component
If you wish to render an action within a custom infolist component,ViewEntry object, or View component object, you may do so using the registerActions() method:
$getAction(), passing the name of the action you registered:
Adding “anonymous” actions to an infolist without attaching them to a component
You may use anActions component to render a set of actions anywhere in the infolist, avoiding the need to register them to any particular component:
Making the independent infolist actions consume the full width of the infolist
You can stretch the independent infolist actions to consume the full width of the infolist usingfullWidth():
Controlling the horizontal alignment of independent infolist actions
Independent infolist actions are aligned to the start of the component by default. You may change this by passingAlignment::Center or Alignment::End to alignment():
Controlling the vertical alignment of independent infolist actions
Independent infolist actions are vertically aligned to the start of the component by default. You may change this by passingAlignment::Center or Alignment::End to verticalAlignment():