I have 2 entities, company and school, I am about to add tags for them. So I added a relation model of ItemTags, it has item_id, item_type (this is either company or school),
I wondering how do I add relationship for itemTags? if there is only one entity, I could just go in itemTags,
public function initialize()
{
$this->belongsTo('school_id', 'Models\School', 'id');
$this->belongsTo('tags_id', 'Models\Tags', 'id');
}
but where do I fit in if I have item_id and item_type?