Conditions | 3 |
Paths | 2 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
70 | public function downloadExportedFile($id) |
||
71 | { |
||
72 | // Map export instance |
||
73 | $export = ModelExport::findOrFail( $id ); |
||
74 | |||
75 | if ( ! file_exists( storage_path( 'app/exports' ) . '/' . $export->file ) || empty( $export->file ) ) { |
||
76 | abort(404); |
||
77 | } |
||
78 | |||
79 | return response()->download( storage_path( 'app/exports/' . $export->file ) ); |
||
80 | } |
||
82 |