diff --git a/config/filesystems.php b/config/filesystems.php index eff4862..1ce0d5f 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -64,9 +64,17 @@ return [ 'url' => env('AWS_URL'), ], - 'media' => [ + 'media_dev' => [ 'driver' => 'local', - 'root' => public_path('uploads'), + 'root' => public_path(), + ], + + 'media' => [ + 'driver' => 'ftp', + 'host' => '185.142.158.22', + 'username' => 'willacdn', + 'password' => 'F9NvDsT*HVhLA@$', + 'root' => 'private_html', ], ], diff --git a/config/medialibrary.php b/config/medialibrary.php index afb616f..7a1a092 100644 --- a/config/medialibrary.php +++ b/config/medialibrary.php @@ -6,7 +6,7 @@ return [ * The disk on which to store added files and derived images by default. Choose * one or more of the disks you've configured in config/filesystems.php. */ - 'disk_name' => env('MEDIA_DISK', 'media'), + 'disk_name' => env('APP_DEBUG', true) ? 'media_dev' : 'media', /* * The maximum file size of an item in bytes. @@ -74,7 +74,7 @@ return [ * When urls to files get generated, this class will be called. Leave empty * if your files are stored locally above the site root or on s3. */ - 'url_generator' => null, + 'url_generator' => env('APP_DEBUG', true) ? null : 'WM\Common\Services\Media\UrlGenerator\FtpUrlGenerator', /* * Whether to activate versioning when urls to files get generated. @@ -85,7 +85,7 @@ return [ /* * The class that contains the strategy for determining a media file's path. */ - 'path_generator' => null, + 'path_generator' => 'WM\Common\Services\Media\PathGenerator', /* * Medialibrary will try to optimize all converted images by removing @@ -153,4 +153,6 @@ return [ 'perform_conversions' => Spatie\MediaLibrary\Jobs\PerformConversions::class, 'generate_responsive_images' => Spatie\MediaLibrary\Jobs\GenerateResponsiveImages::class, ], + + 'wm-cdn' => 'https://cdn.willamall.com', ];