laravel文件存储、删除、移动等操作
xuexi 2024-04-23 16:24:37 发表在:PHP 查看数:631
   public function index()
{
  // 取到磁盘实例
  $disk = Storage::disk('local');

  // 删除单条文件
  $disk->delete('test.txt');
  // 删除多条文件
  $disk->delete(['test22.txt', 'icon.jpg']);
}


'local' => [
            'driver' => 'local',
//            'root'   => storage_path('app'),  在/storage/app/目录
            'root'   => public_path('uploads'), // 在public/uploads/ 目录
        ],

最近访问时间:2025-01-18 08:07:35
知识库:318条鸣谢:TAY  备案号:蜀ICP备2024090044号