未检索图像 Laravel
Image not retrieving Laravel
我正在尝试检索图像。我没有通过 php artisan storage:link
方法创建从 public/storage 到 storage/app/public 的符号 link。而不是这个,我将这段代码添加到 App::make('files')->link(storage_path('app/public'), public_path('storage'));
到 app/providers/AppServiceProvider.php
。但是仍然没有运气图像没有显示,也没有错误。
视图中的代码:
<img src="/public/storage/{{$main->image_dir}}" /> // /public/storage/main/image.jpg
<img src="/storage/{{$main->image_dir}}" /> // /storage/main/image.jpg
<img src="http://localhost:8000/storage/{{$main->image_dir}}" /> // http://localhost:8000/storage/main/image.jpg
我没有得到以上 3 link 中任何一个的图像。图片存储在这里:storage/app/main
.
我解决了问题。
我从 storage/app
中错误地删除了名为 public
的文件夹。我的图像存储在 storage/app/main
中,在这种情况下,无法检索图像。现在它存储在 storage/app/public/main
中并且运行良好。
我正在尝试检索图像。我没有通过 php artisan storage:link
方法创建从 public/storage 到 storage/app/public 的符号 link。而不是这个,我将这段代码添加到 App::make('files')->link(storage_path('app/public'), public_path('storage'));
到 app/providers/AppServiceProvider.php
。但是仍然没有运气图像没有显示,也没有错误。
视图中的代码:
<img src="/public/storage/{{$main->image_dir}}" /> // /public/storage/main/image.jpg
<img src="/storage/{{$main->image_dir}}" /> // /storage/main/image.jpg
<img src="http://localhost:8000/storage/{{$main->image_dir}}" /> // http://localhost:8000/storage/main/image.jpg
我没有得到以上 3 link 中任何一个的图像。图片存储在这里:storage/app/main
.
我解决了问题。
我从 storage/app
中错误地删除了名为 public
的文件夹。我的图像存储在 storage/app/main
中,在这种情况下,无法检索图像。现在它存储在 storage/app/public/main
中并且运行良好。