Laravel 7 干预图像缓存无法更改目录

问题描述

Imagecache 在我的本地主机上工作正常,因为我没有更改认目录结构,但在实时服务器上我更改了它并将除 public 之外的所有文件文件夹放到另一个目录中。结构如下:

  • core_files
  • public_html

我已经在 AppServiceProvider.PHP 中绑定了 public 文件夹,我所有的图片都来自 public_html/images

下面是我的 AppServiceProvider.PHP


use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->bind('path.public',function() {
        return base_path().'/public_http';
        });
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }
}

下面是我的 imagecache.PHP

return [

/*
|--------------------------------------------------------------------------
| Name of route
|--------------------------------------------------------------------------
|
| Enter the routes name to enable dynamic imagecache manipulation.
| This handle will define the first part of the URI:
|
| {route}/{template}/{filename}
|
| Examples: "images","img/cache"
|
*/

'route' => 'business-image',/*
|--------------------------------------------------------------------------
| Storage paths
|--------------------------------------------------------------------------
|
| The following paths will be searched for the image filename,submitted
| by URI.
|
| Define as many directories as you like.
|
*/

'paths' => [
    public_path('images/business'),public_path('images/product'),public_path('images/banners')
],/*
|--------------------------------------------------------------------------
| Manipulation templates
|--------------------------------------------------------------------------
|
| Here you may specify your own manipulation filter templates.
| The keys of this array will define which templates
| are available in the URI:
|
| {route}/{template}/{filename}
|
| The values of this array will define which filter class
| will be applied,by its fully qualified name.
|
*/

'templates' => [
    'small' => 'Intervention\Image\Templates\Small','medium' => 'Intervention\Image\Templates\Medium','large' => 'Intervention\Image\Templates\Large',],/*
|--------------------------------------------------------------------------
| Image Cache Lifetime
|--------------------------------------------------------------------------
|
| Lifetime in minutes of the images handled by the imagecache route.
|
*/

'lifetime' => 43200,

];

请帮忙告诉我我错过了什么。谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)