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

Asinox
Asinox

Hi there, i'm having an issue with model relationship, i have a Plan model, with "many"(hasMany) offerts, but my relationshipis returning 0, here is how looks


//PLAN MODEL
public $hasMany = [                     
            'offert' => ['gdl\Pl\Models\Offert','conditions' => 'enabled = 1'],
    ];

// OFFERT MODEL
public $belongsTo = [
            'plan' => ['gdl\Pl\Models\Plan',]
    ];

//TRYING TO SHOW THE OFFERS
{{ plan.offert}}  

But when im trying to show how many "offert" the plan have, the returned data is 0, but there is more than 0

Any idea?

Thank you

Last updated

1-1 of 1

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