I am trying to bind a downloadable csv template to a button which will sit in storage but i keep receiving an error i have tried below but having no luck can anyone see where i am going wrong?
Download Route
Created a download route which refers to the template in storage.
public function download()
{
return Storage::download('template.csv');
}
route file
Route::get('invites/download', 'InviteController@download')->name('invite.download');
Button
<a href="{{action('InviteController@download')}}" class="btn btn-primary mb-3">Download template</a>
Template location
storage/app/public/template.csv
Error
This is the error i keep receiving.
League \ Flysystem \ FileNotFoundException
File not found at path: template.csv
Can i get some help to see where i am going wrong?