src/Database/Scope/Scope.php
public function applyToModelQuery($query, $table = null)
    {
        if (is_null($this->scope) || $this->onlyScopeRelations) {
            return $query;
        }

        if (is_null($table)) {
            $table = $query->getModel()->getTable();
        }

        return $this->applyToQuery($query, $table);
    }
public function applyToModelQuery($query, $table = null)
    {
        if (is_null($this->scope) || $this->onlyScopeRelations) {
            return $query;
        }

        if (is_null($table)) {
            $table = $query->getModel()->getTable();
        }

        return $this->applyToQuery($query, $table);
    }
public function applyToModelQuery ( $ query , $ table = null ) { if ( is_null ( $ this -> scope ) || $ this -> onlyScopeRelations ) { return $ query ; } if ( is_null ( $ table ) ) { $ table = $ query -> getModel ( ) -> getTable ( ) ; } return $ this -> applyToQuery ( $ query , $ table ) ; }
Scope the given model query to the current tenant.

@param  \Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder  $query
@param  string|null  $table
@return \Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder
Scope the given model query to the current tenant .