I was able to successfully save the generated pdf file to the path storage/app/public/pdf. Now I want to open a link to each pdf file from a data table in a view. I keep getting a 404 error whenever I try to open the link from the table in my view. Any help would be greatly appreciated.
Here is the code for the data table in my view(reportLink is just the name of the pdf file):
<h1 style="text-align:center; font-size:50px;">Report History</h1>
<div id="content">
<table id="datatable" class="table table-bordered table-hover table-sm" border="2" style="width:100%;">
<thead>
<tr>
<th style="height:40px;">Date</th>
<th>Report Type</th>
<th>Customer ID</th>
<th>Product ID</th>
<th>Report PDF</th>
</tr>
</thead>
<tbody>
@foreach($report_archives as $report_archive)
<tr>
<td>{{$report_archive->date}}</td>
<td>{{$report_archive->reportType}}</td>
<td>{{$report_archive->customerID}}</td>
<td>{{$report_archive->productID}}</td>
<td><a href="/storage/app/public/pdf/{{$report_archive->reportLink}}">{{$report_archive->reportLink}}</a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
I have tried using url and asset, but I get an error stating "Unclosed '(' does not match '}' "
<td><a href="{{asset('/storage/app/public/pdf/{{$report_archive->reportLink}}')}}">{{$report_archive->reportLink}}</a></td>
<td><a href="{{url('/storage/app/public/pdf/{{$report_archive->reportLink}}')}}">{{$report_archive->reportLink}}</a></td>