protected function joinRelation(Relation $relationClass)
    {
        switch (get_class($relationClass)) {
            case BelongsToMany::class:
                /* @var BelongsToMany $relationClass */
                $this->joinBelongsToMany($relationClass);
                break;
            case BelongsTo::class:
                /* @var BelongsTo $relationClass */
                $this->joinBelongsTo($relationClass);
                break;
            case HasOne::class:
            case HasMany::class:
                /* @var HasOneOrMany $relationClass */
                $this->joinHasOneOrMany($relationClass);
                break;
        }
    }
protected function joinRelation(Relation $relationClass)
    {
        switch (get_class($relationClass)) {
            case BelongsToMany::class:
                /* @var BelongsToMany $relationClass */
                $this->joinBelongsToMany($relationClass);
                break;
            case BelongsTo::class:
                /* @var BelongsTo $relationClass */
                $this->joinBelongsTo($relationClass);
                break;
            case HasOne::class:
            case HasMany::class:
                /* @var HasOneOrMany $relationClass */
                $this->joinHasOneOrMany($relationClass);
                break;
        }
    }
protected function joinRelation ( Relation $ relationClass ) { switch ( get_class ( $ relationClass ) ) { case BelongsToMany :: class : /* @var BelongsToMany $relationClass */ $ this -> joinBelongsToMany ( $ relationClass ) ; break ; case BelongsTo :: class : /* @var BelongsTo $relationClass */ $ this -> joinBelongsTo ( $ relationClass ) ; break ; case HasOne :: class : case HasMany :: class : /* @var HasOneOrMany $relationClass */ $ this -> joinHasOneOrMany ( $ relationClass ) ; break ; } }
Add joining the tables to query based on the type of relationship.

@param Relation $relationClass

@return $this
Add joining the tables to query based on the type of relationship .