© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
Bleak (GDB Founder)

Create Macro that uses Get Owner Record for Actions

Hi all i reuse this a lot on Actions
->visible(//only visible if $record organization is the same as the current user's organization
                    function () {
                       return $this->getOwnerRecord()->organizations->contains(organization());
                    }
                )
->visible(//only visible if $record organization is the same as the current user's organization
                    function () {
                       return $this->getOwnerRecord()->organizations->contains(organization());
                    }
                )

How can i use it on the AppServiceProvider as the getOwnerRecord method is not there?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

owner record
FilamentFFilament / ❓┊help
2y ago
how to custom actions on create record
FilamentFFilament / ❓┊help
2y ago
Create Actions
FilamentFFilament / ❓┊help
3y ago
Get the owner record while at their Edit Page
FilamentFFilament / ❓┊help
3y ago