4 months ago

Loading model in an entity

Posted 4 months ago by gciliberti

Hello, i'm trying to use php $entity->load(['commissionMembers']); to return it to my view and then use it but i'm getting 'Class name must be a valid object or a string in MorphTo.php line 157'

My entity model has a method

        return $this->hasMany(CommissionMember::class);

I don't know what i'm missing as this is working with other model in the project (but not coded by me, there might be a subtlety that I don't understand).

Please sign in or create an account to participate in this conversation.