This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

yavn
yavn

Model:

public $belongsToMany = [
    'view_permissions' => ['Backend\Models\User', 'table' => 'users_view_permissions']
];

Field:

view_permissions:
    label: View permissions
    tab: Permissions
    type: relation
    nameFrom: first_name
    span: left

How can I mutate relation field options? I want the options to be a concat of two table columns: first_name + second_name. Tried using getViewPermissionsAccessor but it does not work. And I have to use nameFrom because the table doesn't have the default 'name' column.

Looking at the code it seems like here we could apply some sort of query mutator.

dsqr
dsqr

I'm currently having the same issue. Did you come up with a solution already?

yavn
yavn

dsqr said:

I'm currently having the same issue. Did you come up with a solution already?

If you want to hack it there is a temp fix in my feature request on github.

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.