© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
mithyy

Performing action on resource view event

Hello, I have a ContactResource. It contains data from the contact form and is saved as is_read=false by default. I want to make is_read=true when this resource is opened with view in the admin panel. How can I do this? In the documentation https://filamentphp.com/docs/3.x/panels/resources/viewing-records I couldn't find anything related to what I want to do on this page, or I didn't understand it.
Viewing records - Panel Builder - Filament
Solution
public function mount(int|string $record): void
{
    parent::mount($record);
    $this->record->update(['is_read' => true]);
}
public function mount(int|string $record): void
{
    parent::mount($record);
    $this->record->update(['is_read' => true]);
}
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Conditional action on view resource page
FilamentFFilament / ❓┊help
3y ago
Action inside Resource ViewAction blade view
FilamentFFilament / ❓┊help
3y ago
RelationManager on View Resource
FilamentFFilament / ❓┊help
2y ago
Reuse infolist modal from resource on Notification view action
FilamentFFilament / ❓┊help
2y ago