проблема следующая: мне необходимо, чтобы по клику на ссылку пользователь мог скачать файл, для этого в rout и мне надо передать ID файла, чтобы тот передал его в контроллер. Вопрос, как передать переменную в rout?
HTML
<div class="subpage_table">
<table border="0" cellpadding="0" cellspacing="0">
<thead>
<tr>
<td>Наименование файла</td>
<td>Дата загрузки</td>
<td>Размер файла</td>
<td>Пользователь</td>
<td>Скачать</td>
</tr>
<thead>
<tbody>
@foreach ($journal as $record)
<tr>
<td>{{$record->Name}}</td>
<td>{{date('d.m.Y H:i:s',strtotime($record->DateInsert))}}</td>
<td>{{round(($record->Size),2)}} Кб</td>
<td>{{$record->user}}</td>
<td><a href="{{route('download')}}" download><button><div class="download"></div></button></a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
Rout
Route::get('download/{file_id}','Upload@download')->name('download');
Controller (не добит)
public function download($file_id){
$query = DB::table('FileJournal')->where('ID', $file_id))->first();
$file = pg_unescape_bytea($query->File);
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=lalka.docx');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . strlen($file));
echo $file;
}