Anyway to hook into Fields filter to override it #383
-
I have runway resource which is using User Model public function getRoleAttribute()
{
return $this->allRoles()->pluck('title')->join(', ');
} and blueprint field in yaml - handle: role
field:
type: text
display: Roles
listable: true
visibility: computed its using pivot table to store user roles
So when I apply the filter its failing with following message
Problem is that I dont have a Role eloquent model so I cant build a belongsToMany relation on users model. I tried adding a method roles and returning collection but I got it must return relationship error. How can i make it work, anyway I can hook into field filters logic?? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
It should probably filter out "computed" fields from that list. Then, you can create your own filter for the Roles stuff. |
Beta Was this translation helpful? Give feedback.
It should probably filter out "computed" fields from that list.
Then, you can create your own filter for the Roles stuff.