Answer the question
In order to leave comments, you need to log in
How will the third model be received?
There is a consultation model that pulls the patient model along with it. And now how to make the patient model pull the passport?
Now I have $consultation->patient->surname
And I want %consultation->patient->passport->surname
Answer the question
In order to leave comments, you need to log in
And now how to make the patient model pull a passport?
consultation model that pulls the patient model along with it
// контроллер
$consultations = Consultation::with('patient.passports')->get()
// blade
@foreach($consultations as $consultation)
{{ $consultation->created_at }}
{{ $consultation->patient->created_at}}
@foreach($consultation->patient->passports as $client_passport)
{{ $client_passport->surname }}
@endforeach
@endforeach
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question