laravel文件管理器上传图像后不显示

时间:2018-10-16 17:32:35

标签: laravel

Laravel version :5.6
Package version :1.8

在本地一切正常,但是在我将laravel项目上传到主机后,lfm无法正常工作。我的图像上传没有问题,但是没有显示在资源管理器部分,我发现发生了此问题,因为在图像URL中添加了lfm前缀。

`/*
|--------------------------------------------------------------------------
| Routing
|--------------------------------------------------------------------------
*/

// Include to pre-defined routes from package or not. Middlewares
'use_package_routes' => true,

// Middlewares which should be applied to all package routes.
// For laravel 5.1 and before, remove 'web' from the array.
'middlewares' => ['web','auth:admin'],

// The url to this package. Change it if necessary.
'prefix' => 'admin/laravel-filemanager',

/*
|--------------------------------------------------------------------------
| Multi-User Mode
|--------------------------------------------------------------------------
*/

// If true, private folders will be created for each signed-in user.
'allow_multi_user' => true,
// If true, share folder will be created when allow_multi_user is true.
'allow_share_folder' => false,

// Flexibla way to customize client folders accessibility
// If you want to customize client folders, publish tag="lfm_handler"
// Then you can rewrite userField function in App\Handler\ConfigHander class
// And set 'user_field' to App\Handler\ConfigHander::class
// Ex: The private folder of user will be named as the user id.
'user_field' => Unisharp\Laravelfilemanager\Handlers\ConfigHandler::class,

/*
|--------------------------------------------------------------------------
| Working Directory
|--------------------------------------------------------------------------
*/

// Which folder to store files in project, fill in 'public', 'resources', 'storage' and so on.
// You should create routes to serve images if it is not set to public.
'base_directory' => 'public_html',

'images_folder_name' => 'images/news',
'files_folder_name'  => 'files',

'shared_folder_name' => 'shares',
'thumb_folder_name'  => 'thumbs',`

如您所见,我的图像存储在public_html / images / news文件夹中,但资源管理器中图像的src是“ admin / laravel-filemanager / images / news”。

我发现的另一件事是,如果“ base_directory”设置为“ public”,则URL是正确的。但是如果更改为“ public_html”,则会发生此问题。

如果有人提供任何解决方案的提示,我们深表感谢。

0 个答案:

没有答案