first upload all files
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Import\Http\Controllers\Admin;
|
||||
|
||||
class DownloadCsvController
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$import_types = ['product' => 'products.csv'];
|
||||
|
||||
if (array_key_exists(request('import_type'), $import_types)) {
|
||||
$path = storage_path('app/csv_templates/' . $import_types[request('import_type')]);
|
||||
|
||||
return response()->download($path);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user