laravel-6 support

This commit is contained in:
RafficMohammed
2023-01-08 01:17:22 +05:30
parent 1a5c16ae4b
commit 774eed8b0e
4962 changed files with 279380 additions and 297961 deletions

View File

@@ -2,18 +2,18 @@
namespace UniSharp\LaravelFilemanager\Controllers;
/**
* Class DownloadController.
*/
use Illuminate\Support\Facades\Storage;
class DownloadController extends LfmController
{
/**
* Download a file.
*
* @return mixed
*/
public function getDownload()
{
return response()->download(parent::getCurrentPath(request('file')));
$file = $this->lfm->setName(request('file'));
if (!Storage::disk($this->helper->config('disk'))->exists($file->path('storage'))) {
abort(404);
}
return response()->download($file->path('absolute'));
}
}