October CMS resources and help articles

Simple and to the point. Optimized by the community.

Render Relation List/Form with trashed datas

by Slevin, last modified on November 20th, 2021

Sometimes, you have a model with related datas but those datas have softDelete enabled. And when you try to access the parent model, you may encounter an error due to some partials in your model form or list.

To avoid getting this error, you need to configure your relation to get the data with trashed.

Go to your parent model, and change your relation like this :

    public $belongsTo = [
        'relationName' => [ 

and all works again.



We use cookies to measure the performance of this website. Do you want to accept these cookies?