Summer Sale! All accounts are 50% off this week.

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.