public function mergeModelDefinedRelationConstraints( Builder $relation )
	{
		$removedScopes = $relation->removedScopes();

		$relationQuery = $relation->getQuery();

		// Here we have some relation query and the original relation. We need to copy over any
		// where clauses that the developer may have put in the relation definition function.
		// We need to remove any global scopes that the developer already removed as well.
		return $this->withoutGlobalScopes( $removedScopes )->mergeWheres( $relationQuery->wheres, $relationQuery->getBindings() );
	}
public function mergeModelDefinedRelationConstraints( Builder $relation )
	{
		$removedScopes = $relation->removedScopes();

		$relationQuery = $relation->getQuery();

		// Here we have some relation query and the original relation. We need to copy over any
		// where clauses that the developer may have put in the relation definition function.
		// We need to remove any global scopes that the developer already removed as well.
		return $this->withoutGlobalScopes( $removedScopes )->mergeWheres( $relationQuery->wheres, $relationQuery->getBindings() );
	}
public function mergeModelDefinedRelationConstraints ( Builder $ relation ) { $ removedScopes = $ relation -> removedScopes ( ) ; $ relationQuery = $ relation -> getQuery ( ) ; // Here we have some relation query and the original relation. We need to copy over any // where clauses that the developer may have put in the relation definition function. // We need to remove any global scopes that the developer already removed as well. return $ this -> withoutGlobalScopes ( $ removedScopes ) -> mergeWheres ( $ relationQuery -> wheres , $ relationQuery -> getBindings ( ) ) ; }
Merge the constraints from a relation query to the current query.

@param Builder $relation
@return Builder|static
Merge the constraints from a relation query to the current query .