Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,16 @@ public function newQuery()
return $this->registerGlobalScopes($this->newQueryWithoutScopes());
}

/**
* Begin querying the model with given connection.
*
* @return Builder
*/
public static function queryWithConnection(string $connection)
{
return (new static)->setConnection($connection)->newQuery();
}

/**
* Get a new query builder that doesn't have any global scopes or eager loading.
*
Expand Down