public newQueryWithoutTenants ( |
||
$model | ||
return |
public function newQueryWithoutTenants(Model $model)
{
return $model->newQuery()->withoutGlobalScopes($this->tenants->keys()->toArray());
}
/** * Returns a new query builder without any of the tenant scopes applied. * * $allUsers = User::allTenants()->get(); * * @return \Illuminate\Database\Eloquent\Builder */ public static function allTenants() { return static::$landlord->newQueryWithoutTenants(new static()); }