@mstnorris You can use pseudo relation:
// Post model (question)
public function markedAnswer()
{
return $this->hasOne(Answer::class)->where('is_marked', true);
}
BTW be careful with ternary operators like this:
thread->is_question ? $thread->answer_id ? 'panel-success' : 'panel-info' : 'panel-default'
Can you tell me what it will return? Read this http://php.net/manual/en/language.operators.comparison.php#example-138