By the way, this does work but feels messy when I have the rest of these checks in the policy.
->visible(function(Message $message) {
return $message->status === MessageStatus::DRAFT;
})```
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am creating a custom action for sending emails, is there a filament way of linking this action to show/hide based on policy? I currently have the built in actions working with policies fine, would be nice if there was a simple, clean solution to do this, can't find anything in the docs.
Thanks
I found the solution to this, calling authorise on the custom action and passing in the model works.
Action::make('createMember')
->label('Create Member')
->slideOver()
->form(User::getEditForm(isChild: false))
->action(function(UserService $userService, array $data) {
$gym = Filament::getTenant();
$userService->createMember(
gym: $gym,
data: ['member' => $data]
);
})
->authorize('create', User::class)
->modalWidth(MaxWidth::Large),
Please or to participate in this conversation.