Great work on Landlord, however, it does not seem to work with ORM relationships.
My member model has a tenant column called site_id. I have a another model called Profile that has a relationship to Member, but no site_id.
I'm calling Landlord::addTenant('site_id', $data['siteId']) in my middleware.
class Member extends Model
{
use BelongsToTenant;
}
class Profile extends Model
{
public function member()
{
return $this->hasOne('Models\Member');
}
}
If I tried to find a record using a profile id, the Landlord tenant code does not protect the reference to member.
$profile = Profile::find(1)
$profile->member // returns the member record regardless of the tenant column set.
Am I missing something or is there a way to address this?
Great work on Landlord, however, it does not seem to work with ORM relationships.
My member model has a tenant column called site_id. I have a another model called Profile that has a relationship to Member, but no site_id.
I'm calling Landlord::addTenant('site_id', $data['siteId']) in my middleware.
If I tried to find a record using a profile id, the Landlord tenant code does not protect the reference to member.
Am I missing something or is there a way to address this?