i am trying to make a dynamic list of downwload links in my view but i am not quite sure how to return the response::download
for each link
this is what i tried...
1.-My View
@extends('layouts.main')
@section('content')
@foreach($files as $file)
<div class = "row fondue">
<h3><div class="col-md-12"><b><?php echo link_to("/home/download",$file->name,$file)?> </b></div></h3>
</div>
@endforeach
@stop
im not sure if i can send a third parameter to the link_to
2.-My Route
Route::get('/home/download','HomeController@downloadfile')->before('auth');
3.-My function in the controller
public function downloadfile($file)
{
return Response::download($file->route);
}
the view seems normal but when clicking on the links im getting the error:
"Missing argument 1 for HomeController::downloadfile()"
so my doubt is....how can i send the argument missing from the link in my view to my controller?
also...there is a better way to do that?