public function whereRelatedHasCount($relationship, $count = 1, $depth = 0, $operator = '>=')
	{
		$rel  = $this->$relationship();
		$keys = $rel->getConstrainedKeysByCount($count, $operator);

		return $this->where($rel->getLocalKey(), 'IN', $keys, 'and', $depth);
	}
public function whereRelatedHasCount($relationship, $count = 1, $depth = 0, $operator = '>=')
	{
		$rel  = $this->$relationship();
		$keys = $rel->getConstrainedKeysByCount($count, $operator);

		return $this->where($rel->getLocalKey(), 'IN', $keys, 'and', $depth);
	}
public function whereRelatedHasCount ( $ relationship , $ count = 1 , $ depth = 0 , $ operator = '>=' ) { $ rel = $ this -> $ relationship ( ) ; $ keys = $ rel -> getConstrainedKeysByCount ( $ count , $ operator ) ; return $ this -> where ( $ rel -> getLocalKey ( ) , 'IN' , $ keys , 'and' , $ depth ) ; }
Selects rows where related table has at least x number of entries

NOTE: whereas other 'where' clauses can be called statically due to their
location in the query builder class, this method cannot be as it is attached
directly to the model itself.

@param   string  $relationship  The relationship name to constrain against
@param   int     $count         The minimum number of rows required
@param   int     $depth         The depth level of the clause, for sub clauses
@param   string  $operator      The comparison operator used between the column and the count
@return  $this
@since   2.0.0
Selects rows where related table has at least x number of entries