Visible for Attach Action In Relation Manager
Hi all , currently im developing a project that requires me to use belongstomany relationship.
i have model name as Bucket which that containt belongstomany relationship by using applications() function to call ApplicationBucket model. ( please refer to my pic )
in ApplicationBucket model , it has 2 model which are referring to bucket and application model ( please refer to my pic ) .
in bucket model , i have attribute bucket_status_id .
i created BucketResource and ApplicationRelationManager . I put ApplicationRelationManager class in BucketResource file.
i want to hide attach , edit and detach function in relation manager table when the bucket_status_id = 2 .
i dont have any ideas how to query . any ideas ?



2 Replies
https://filamentphp.com/docs/3.x/panels/resources/relation-managers#accessing-the-relationships-owner-record
You can use
->visible()
and inject $livewire
thanks for the idea . i was stuck on that part for a month . finally worked! . Thanks again