覆盖 Laravel "航行员" 默认下载图像的路径

Voyager 默认情况下,将图像下载到文件夹 storage/app/public/posts 对于所选消息图像。
我想将其缩小到Shared文件夹中的用户文件夹。

我该如何实现这一目标?

先感谢您。
已邀请:

董宝中

赞同来自:

打开文件
config/filesystems.php

和检查
https://github.com/laravel/lar ... 1-L66
部分。 例如,添加另一个密钥
voyager

.


'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path/'app'/,
],
'public' => [
'driver' => 'local',
'root' => storage_path/'app/public'/,
'url' => env/'APP_URL'/.'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env/'AWS_ACCESS_KEY_ID'/,
'secret' => env/'AWS_SECRET_ACCESS_KEY'/,
'region' => env/'AWS_DEFAULT_REGION'/,
'bucket' => env/'AWS_BUCKET'/,
],
'voyager' => [
'driver' => 'local',
'root' => storage_path/'app/public'/,// change here something specific to your application need
'url' => env/'APP_URL'/.'/storage',
'visibility' => 'public',
],
],


然后打开
https://github.com/the-control ... 9-L70
config/voyager.php

并设置这个键 /
'voyager'

/ 反而 'public' 通过以下方式:


'storage' => [
'disk' => 'voyager',
],

詹大官人

赞同来自:

切换到 config/filesystems.php 并改变根和 URL 新文件夹的关键。 见下文示例


'public' => [
'driver' => 'local',
'root' => public_path//.'/app', //Add new folder into public folder called app
'url' => env/'APP_URL'/.'/public/app', //change get path for image
'visibility' => 'public',
],

要回复问题请先登录注册