I have this query:
public function getRegistrationInfo($regID){
$registration = Registration::with('conference',Conference.registrationTypes','Conference.registrationTypes.participants')
->where('id',$regID)->first();
return view('pdf.registration',compact('registration'));
}
And in the view "pdf.registration" I have this to show the query results:
@foreach($registration->conference->registrationTypes as $key=>$registrationType)
<li>
<span>show the registration ID here : {{$registration->id}}</span> <br>
<span>Conference name {{$registration->conference->name}}</span><br>
<span>Registration type: {{$registration->conference->registrationTypes[$key]['name']}}</span><br>
<span> Participant: {{$registration->conference->registrationTypes[$key]
->participants[0]->name .' '.$registration->
conference->registrationTypes[$key]->participants[0]->surname}}</span><br>
<span>Price: {{$registration->conference->registrationTypes[$key]['price']}}</span><br>
</li>
@endforeach
So in the view appears a list with two list items showing the info of each participant associated with the registration:
show the registration ID here : 1
Conference name: conference test title
Registration type: general
Participant: John K
Price: 0
show the registration ID here : 1
Conference name : conference test ttile
Registration type: plus
Participant: Jake W
Price: 10
Do you know what is necessary to show this results in this list above in a pdf? And each list item in a page of the pdf?