src/Repositories/AbstractEloquentRepository.php
public function with($relationships)
    {
        if (! is_array($relationships)) {
            $relationships = explode(', ', $relationships);
        }

        if (! in_array($relationships, $this->withRelationships)) {
            foreach ($relationships as $with) {
                $this->withRelationships[] = $with;
            }
        }

        return $this;
    }
public function with($relationships)
    {
        if (! is_array($relationships)) {
            $relationships = explode(', ', $relationships);
        }

        if (! in_array($relationships, $this->withRelationships)) {
            foreach ($relationships as $with) {
                $this->withRelationships[] = $with;
            }
        }

        return $this;
    }
public function with ( $ relationships ) { if ( ! is_array ( $ relationships ) ) { $ relationships = explode ( ', ' , $ relationships ) ; } if ( ! in_array ( $ relationships , $ this -> withRelationships ) ) { foreach ( $ relationships as $ with ) { $ this -> withRelationships [ ] = $ with ; } } return $ this ; }
Assign eager loading relationships.

@param  string|array  $relationships
@return AbstractEloquentRepository
Assign eager loading relationships .