Class definition is - a body of students meeting regularly to study the same subject. The hasOne method is available to your model via the model's Illuminate\Database\Eloquent\Model base class: