Relation manager filter data
How to make user to only see their list of data in relation manager if its role_id is 4?
4 Replies
Can you explain your problem a bit more? What is the resource, what is the relationship, etc.
I have a list of data in relation manager, which is belongs to user..
when a logged user with role_id = 4, they should only see their belonging data in the list..
the model of relation manager is Campaign_ref, which has a column user_id..
user_id has a column called role_id..
in campaign_ref model has a method called user that is returning belongsTo method to user model..
is this enough to understand?
can i approch my goal above with viewAny in laravel policy in campaignRef model?
if it can, how can i do it?
So the relation manager is
campaign_ref
, what is the resource? Is it UserResource
?the resource is CampaignResource
can i have a custom query in relation manager like getEloquentQuery in resource?
nevermind, i got it with getTableQuery()
thanks btw for your answers before @pboivin