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

Jaap
Jaap

I have an Song that belongsTo a user. I can show the user[name] and user[surname] in the list backend view which works fine. But as soon as a user gets softDeleted() I still want the Song list to include that Song with the softDeleted user data, but instead I get an error message: "Trying to get property of non-object". I know this is because the relation query does not include a withTrashed clause, but I can't see where I can add that clause in the columns.yaml file. It is ofcourse possible to write a custom select, but that is not so elegant, so is there a better solution for this?

Jaap
Jaap

The solution i have found now is not perfect but at least stops error generation.

name:
    label: First name
    searchable: true
    relation: user
    valueFrom: name
    default: deleted
surname:
    label: Last name
    searchable: true
    relation: user
    valueFrom: surname
    default: deleted

but it would be nice if that deleted value could be replaced by the actual user name which is (soft)deleted

Last updated

1-2 of 2

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