Where to Inject a Custom Action in Filament EditPage After Policy and Validation Are Passed?
Hi everyone! đź‘‹
I'm currently building a custom
UpdateUserAction
and would like to integrate it properly into a Filament EditRecord
page.
---
âś… My Goal:
I want to run a custom action (e.g., UpdateUserAction
) only after:
1. Policy Authorization has passed (can:update
on the model)
2. Validation has been successfully performed using the form schema
3. Data has been potentially transformed (if needed)
---
🤔 My Main Question:
Which method inside the EditRecord
or EditUser
page is best for injecting a custom action after authorization and validation have passed?
I want to avoid doing policy or validation inside the action itself — my goal is to delegate those responsibilities to Filament’s internal authorization and validation flow, and only call the action after that.
For example:
Is handleRecordUpdate()
guaranteed to run only after policy and validation have passed?
If not, is there a more appropriate method to override?
---
🛠️ Context:
I want to avoid calling FormRequest
manually inside this method — I'd rather lean on Filament’s built-in validation and authorization mechanisms that already wrap around the EditPage lifecycle.
---
🙏 What I'm Looking For:
* Confirmation that handleRecordUpdate()
is the right place to inject my custom action.
* If not, what would be the best method/hook to override?
* Any example of delegating business logic into an action after Filament’s validation/policy pipeline.
Thanks in advance for your help! I’d love to make this pattern as clean and idiomatic as possible with Filament. 🔧1 Reply
I think you can use
handleRecordUpdate
, and the authorization and validation is already done