src/mako/database/midgard/Query.php
public function excluding($excludes)
	{
		if($excludes === true)
		{
			$this->model->setIncludes([]);
		}
		else
		{
			$excludes = (array) $excludes;

			$includes = $this->model->getIncludes();

			foreach($excludes as $key => $relation)
			{
				if(is_string($relation) && isset($includes[$relation]))
				{
					unset($includes[$relation], $excludes[$key]); // Unset relations that may have been set with a criterion closure
				}
			}

			$this->model->setIncludes(array_udiff($includes, $excludes, function($a, $b)
			{
				return $a === $b ? 0 : -1;
			}));
		}

		return $this;
	}
public function excluding($excludes)
	{
		if($excludes === true)
		{
			$this->model->setIncludes([]);
		}
		else
		{
			$excludes = (array) $excludes;

			$includes = $this->model->getIncludes();

			foreach($excludes as $key => $relation)
			{
				if(is_string($relation) && isset($includes[$relation]))
				{
					unset($includes[$relation], $excludes[$key]); // Unset relations that may have been set with a criterion closure
				}
			}

			$this->model->setIncludes(array_udiff($includes, $excludes, function($a, $b)
			{
				return $a === $b ? 0 : -1;
			}));
		}

		return $this;
	}
public function excluding ( $ excludes ) { if ( $ excludes === true ) { $ this -> model -> setIncludes ( [ ] ) ; } else { $ excludes = ( array ) $ excludes ; $ includes = $ this -> model -> getIncludes ( ) ; foreach ( $ excludes as $ key => $ relation ) { if ( is_string ( $ relation ) && isset ( $ includes [ $ relation ] ) ) { unset ( $ includes [ $ relation ] , $ excludes [ $ key ] ) ; // Unset relations that may have been set with a criterion closure } } $ this -> model -> setIncludes ( array_udiff ( $ includes , $ excludes , function ( $ a , $ b ) { return $ a === $ b ? 0 : - 1 ; } ) ) ; } return $ this ; }
Removes relations to eager load.

@param  string|array|bool $excludes Relation or array of relations to exclude from eager loading
@return $this
Removes relations to eager load .