Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

damann8479's avatar

Filament Edit Action

Hello :-)

is it possible in filament to only make the edit button visible if a condition from the database applies? For example, editing should only be possible if created_at and updated_at are the same

0 likes
1 reply
AlbertLens's avatar
Level 1

Hello. Of course it is possible. I use the following:

            Actions\EditAction::make()
            ->visible(function (): bool {
               		$visible = $this->record->id>10; // or whatever condition you need and return TRUE or FALSE
	                return $visible;
            })
```

This is working for me.
When the condition is true the button for the EditAction is shown. When the condition is false, it is not shown.

Hope it helps.

Please or to participate in this conversation.