The error says Call to undefined method App\Models\Tenant\Survey::firstSurveySection.firstSurveyQuestion() but it is since the first line works and returns the correct information.
These are the relationships in the models
//Survey
public function firstSurveySection()
{
return $this->hasOne(SurveySection::class)->where('number', '=', 1);
}
//SurveySection
public function firstSurveyQuestion()
{
return $this->hasOne(SurveyQuestion::class)->where('number', '=', 1);
}
//SurveyQuestion
public function surveyQuestionOptions()
{
return $this->hasMany(SurveyQuestionOption::class)->orderBy('number');
}