Currently, I am facing an issue where I have a table generated from a foreach loop as shown below and attempting to pass it through a URL path href=" {{ url('grade/semester/schoolyear')}} "
SEMESTER | SCHOOL YEAR | Action |
---|---|---|
1st | 2020-2021 | View |
2nd | 2019-2020 | View |
1st | 2018-2019 | View |
2nd | 2018-2019 | View |
Blade Code:
<table class="table">
<thead>
<tr >
<th scope="col" style="color:#1a0dab">Semester</th>
<th scope="col" style="color:#1a0dab">Academic Year</th>
<th scope="col" style="color:#1a0dab">Action</th>
</tr>
</thead>
<tbody>
@foreach($years as $year)
<tr>
<td style="text-align: left;">{{ $year->sem}}</td>
<td>{{ $year->sy}} </td>
<td>
<a title="View Grade" **href="{{ url('/grade/{{$year->sem}}/{{$year->sy}}')}}"**>
<i class="fas fa-file-alt"></i>
</a>
<a title="Print Grade" href="#">
<i class="fas fa-print"></i>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
My goal is to achieve the correct route: Clicking on the "View" link in the third row of my table should redirect me to the correct path.
Thank you for your assistance.