The first i´m sorry for this question, i know that maybe it´s very bad. I´m reading much for relation with model in laravel but i don´t understand i don´t know to apply.
my problem it´s:
i have one Model session
and i have one model patient
one patient receive one or many session and one session it´s for one patient, ok¿?? My application it´s for physiotherapy clinic.
in my model Session
i have this:
public function patient()
{
return $this->hasOne(Patient::class, 'id');
}
and in my model patient i don´t know if i have to to do anything or i have to to do this:
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMnay
**/
public function sesiones()
{
return $this->hasMany(\App\Sesion::class, 'id');
}
one patient can get one or any sessions and one session it´s for one pattient i have more relations but i need to know to do one for to do next.
i´m doing this question, because my application web, returned this error:
STATUS_BREAKPOINT
and i think that my relations it´s bad and hang up my application
Thanks so much for help. And sorry for my question
updated
if i want to show doctor in sessions... I have this:
in model Session:
public function doctor(){
return $this->belongsTo(Doctor::class);
}
and in model Doctor
public function Doctor(){
return $this->belongsTo(Session::class);
}
but i can´t show in my table doctor that did this session