📜  laravel 响应下载视频 laravel medialibrary - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:49.908000             🧑  作者: Mango

代码示例1
use Spatie\MediaLibrary\MediaCollections\Models\Media;

class DownloadMediaController
{
   public function show(Media $mediaItem)
   {
       return response()->download($mediaItem->getPath(), $mediaItem->file_name);
   }
}