Files
faveo/vendor/unisharp/laravel-filemanager/src/Controllers/DownloadController.php
RafficMohammed 774eed8b0e laravel-6 support
2023-01-08 01:17:22 +05:30

20 lines
442 B
PHP

<?php
namespace UniSharp\LaravelFilemanager\Controllers;
use Illuminate\Support\Facades\Storage;
class DownloadController extends LfmController
{
public function getDownload()
{
$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'));
}
}