hasMany(JointPermission::class, 'entity_id', 'entity_id') ->whereColumn('search_vectors.entity_type', '=', 'joint_permissions.entity_type'); } }