src/Models/Tenant.php
public function scopeOfOwner(Builder $builder, Model $owner): Builder
    {
        return $builder->where('owner_type', $owner->getMorphClass())->where('owner_id', $owner->getKey());
    }
public function scopeOfOwner(Builder $builder, Model $owner): Builder
    {
        return $builder->where('owner_type', $owner->getMorphClass())->where('owner_id', $owner->getKey());
    }
public function scopeOfOwner ( Builder $ builder , Model $ owner ) : Builder { return $ builder -> where ( 'owner_type' , $ owner -> getMorphClass ( ) ) -> where ( 'owner_id' , $ owner -> getKey ( ) ) ; }
Get tenants of the given owner.

@param \Illuminate\Database\Eloquent\Builder $builder
@param \Illuminate\Database\Eloquent\Model   $owner

@return \Illuminate\Database\Eloquent\Builder
Get tenants of the given owner .