diff --git a/app/Http/Controllers/GenDocController.php b/app/Http/Controllers/GenDocController.php index 05bd4b4..e182bff 100644 --- a/app/Http/Controllers/GenDocController.php +++ b/app/Http/Controllers/GenDocController.php @@ -16,7 +16,7 @@ class GenDocController extends Controller { $entity_id=0; } - $documenti = GenDoc::listDocument($entity,$entity_id); + $documenti = GenDoc::listDocument($entity,$entity_id); return view('conti.documenti.gendoc', [ 'id'=>$entity_id, 'entity'=>$entity, @@ -35,5 +35,9 @@ class GenDocController extends Controller return redirect()->back(); } - + public function downloadFile($id){ + $doc = Gendoc::find($id)->get(); + return response()->download($doc->filename); + } + } diff --git a/resources/views/conti/documenti/gendoc.blade.php b/resources/views/conti/documenti/gendoc.blade.php index 279f6c0..c70ed62 100644 --- a/resources/views/conti/documenti/gendoc.blade.php +++ b/resources/views/conti/documenti/gendoc.blade.php @@ -51,7 +51,7 @@ @foreach($documenti as $documento)