First, define a named route in your web.php:
Route::get('student/exams/pdf/{student}', 'StudentExamsController@printPDF')->name('student.exams.pdf');
Then, update your Blade template to use the route:
<a class="btn btn-primary" href="{{ route('student.exams.pdf', $singleStudent->id) }}" role="button">View / Print Final Transcript</a>
@if ($singleStudent) <a class="btn btn-primary" href="{{ route('student.exams.pdf', $singleStudent->id) }}" role="button">View / Print Final Transcript</a> @endif
And similarly, check before your foreach loop:
@if ($examsrecordSingle) @foreach ($examsrecordSingle as $key => $student) <!-- Table row --> @endforeach @endif
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community