public function getHas(string $relation, array $where = [], array $with = [], int $hasAtLeast = 1)
    {
        $query = $this->make($with);

        $query = $this->applyWhere($query, $where);

        return $query->has($relation, '>=', $hasAtLeast)->get();
    }
public function getHas(string $relation, array $where = [], array $with = [], int $hasAtLeast = 1)
    {
        $query = $this->make($with);

        $query = $this->applyWhere($query, $where);

        return $query->has($relation, '>=', $hasAtLeast)->get();
    }
public function getHas ( string $ relation , array $ where = [ ] , array $ with = [ ] , int $ hasAtLeast = 1 ) { $ query = $ this -> make ( $ with ) ; $ query = $ this -> applyWhere ( $ query , $ where ) ; return $ query -> has ( $ relation , '>=' , $ hasAtLeast ) -> get ( ) ; }
Return all results that have a required relationship.

@param string $relation
@param array $where
@param array $with
@param int $hasAtLeast = 1

@return Collection
Return all results that have a required relationship .