public function with($relations)
    {
        $relations = is_array($relations) ? $relations : func_get_args();

        foreach ($relations as $relation => $constraint) {
            if (is_numeric($relation)) {
                $relation = $constraint;
                $constraint = null;
            }

            $this->with = array_merge($this->with, [$relation => $constraint]);
        }

        return $this;
    }
public function with($relations)
    {
        $relations = is_array($relations) ? $relations : func_get_args();

        foreach ($relations as $relation => $constraint) {
            if (is_numeric($relation)) {
                $relation = $constraint;
                $constraint = null;
            }

            $this->with = array_merge($this->with, [$relation => $constraint]);
        }

        return $this;
    }
public function with ( $ relations ) { $ relations = is_array ( $ relations ) ? $ relations : func_get_args ( ) ; foreach ( $ relations as $ relation => $ constraint ) { if ( is_numeric ( $ relation ) ) { $ relation = $ constraint ; $ constraint = null ; } $ this -> with = array_merge ( $ this -> with , [ $ relation => $ constraint ] ) ; } return $ this ; }
Include relations to the transform.

@param  string[]|string $relations
@return $this
Include relations to the transform .