public function hasManyThroughTwo($related, $through, $throughSecond, $firstKey = null, $secondKey = null, $thirdKey = null, $localKey = null, $secondLocalKey = null, $thirdLocalKey = null, $distinct = true, $where = [])
    {
        // Example
        // model = group
        // group.id = schedule.group_id
        // skill.id = schedule.skill_id
        // teacher.id = skill.teacher_id

        $instance = $this->newRelatedInstance($related);

        $throughSecond = new $throughSecond();
        $through = new $through();

        $firstKey = $firstKey ?: $this->getForeignKey();

        $secondKey = $secondKey ?: $throughSecond->getForeignKey();

        $thirdKey = $thirdKey ?: ($through->getTable().'.'.$instance->getForeignKey());

        $localKey = $localKey ?: $this->getKeyName();

        $secondLocalKey = $secondLocalKey ?: $throughSecond->getKeyName();

        $thirdLocalKey = $thirdLocalKey ?: ($instance->getTable().'.'.$instance->getKeyName());

        $query = $instance
            ->newQuery();
        if ($distinct) {
            $query->distinct();
        }

        if (!empty($where)) {
            $query->where($where);
        }

        $query->join($through->getTable(), $thirdKey, '=', $thirdLocalKey);

        return new HasManyThroughTwo($query, $this, $throughSecond, $through, $firstKey, $secondKey, $localKey, $secondLocalKey);
    }