相关疑难解决方法(0)

Laravel - 保存在存储文件夹中的图像不显示给用户

我有这个代码在 storage/app/uploads 文件夹中保存图像

 $image_main = Image::where('property_id', $id)->get();

$file = $request->file('file');
      $destinationPath = 'uploads';
      $i = 0;
      foreach ($file as $file1) {
          $i++;
          $extension = $file1->getClientOriginalExtension();
          $path = $file1->storeAs(
              $destinationPath, $i.time().".".$extension
          );
Run Code Online (Sandbox Code Playgroud)

这是我的刀片文件

@foreach ($image_main as $images)
        <img src="{{"/storage/app/".$images->filename}}
Run Code Online (Sandbox Code Playgroud)

该文件保存在 storage/app/uploads 文件夹中,但没有向用户显示,它说找不到文件。我要在 filesystems.php 文件中设置任何内容吗

php laravel laravel-5

7
推荐指数
4
解决办法
3万
查看次数

标签 统计

laravel ×1

laravel-5 ×1

php ×1