| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <?php
- use Spatie\MediaLibrary\Conversions\ImageGenerators\Image;
- use Spatie\MediaLibrary\Conversions\ImageGenerators\Pdf;
- use Spatie\MediaLibrary\Conversions\ImageGenerators\Svg;
- use Spatie\MediaLibrary\Conversions\ImageGenerators\Video;
- use Spatie\MediaLibrary\Conversions\ImageGenerators\Webp;
- use Spatie\MediaLibrary\Conversions\ImageGenerators\Avif;
- use Spatie\MediaLibrary\Conversions\Jobs\PerformConversionsJob;
- use Spatie\MediaLibrary\Downloaders\DefaultDownloader;
- use Spatie\MediaLibrary\MediaCollections\Models\Media;
- use Spatie\MediaLibrary\MediaCollections\Models\Observers\MediaObserver;
- use Spatie\MediaLibrary\ResponsiveImages\Jobs\GenerateResponsiveImagesJob;
- use Spatie\MediaLibrary\ResponsiveImages\TinyPlaceholderGenerator\Blurred;
- use Spatie\MediaLibrary\ResponsiveImages\WidthCalculator\FileSizeOptimizedWidthCalculator;
- use Spatie\MediaLibrary\Support\FileNamer\DefaultFileNamer;
- use Spatie\MediaLibrary\Support\FileRemover\DefaultFileRemover;
- use Spatie\MediaLibrary\Support\PathGenerator\DefaultPathGenerator;
- use Spatie\MediaLibrary\Support\UrlGenerator\DefaultUrlGenerator;
- use Spatie\MediaLibraryPro\Models\TemporaryUpload;
- return [
- /*
- * The disk on which to store added files and derived images by default.
- */
- 'disk_name' => env('MEDIA_DISK', 's3'),
- /*
- * The disk for conversions when not explicitly specified.
- */
- 'conversions_disk_name' => env('MEDIA_CONVERSIONS_DISK', null),
- /*
- * The maximum file size of an item in bytes.
- */
- 'max_file_size' => 1024 * 1024 * 10,
- /*
- * Disallowed file extensions.
- */
- 'disallowed_extensions' => [
- 'php', 'php3', 'php4', 'php5', 'php6', 'php7', 'php8',
- 'phtml', 'phtm', 'pht', 'phps', 'phar',
- 'shtml', 'shtm', 'stm',
- 'htaccess', 'htpasswd',
- 'cgi', 'pl', 'asp', 'aspx', 'jsp', 'jspx',
- ],
- /*
- * Allowed file extensions filter.
- */
- 'allowed_extensions' => null,
- /*
- * Queue connection for generating derived images.
- */
- 'queue_connection_name' => env('QUEUE_CONNECTION', 'sync'),
- /*
- * Queue name for generating derived images.
- */
- 'queue_name' => env('MEDIA_QUEUE', ''),
- /*
- * Queue conversions by default.
- */
- 'queue_conversions_by_default' => env('QUEUE_CONVERSIONS_BY_DEFAULT', true),
- /*
- * Should DB transactions be run after DB commits.
- */
- 'queue_conversions_after_database_commit' => env('QUEUE_CONVERSIONS_AFTER_DB_COMMIT', true),
- /*
- * The fully qualified class name of the media model.
- */
- 'media_model' => Media::class,
- /*
- * The fully qualified class name of the media observer.
- */
- 'media_observer' => MediaObserver::class,
- /*
- * Media collection serialization.
- */
- 'use_default_collection_serialization' => false,
- /*
- * Temporary upload model (Media Library Pro).
- */
- 'temporary_upload_model' => TemporaryUpload::class,
- /*
- * Enable temporary uploads session affinity.
- */
- 'enable_temporary_uploads_session_affinity' => true,
- /*
- * Generate thumbnails for temporary uploads.
- */
- 'generate_thumbnails_for_temporary_uploads' => true,
- /*
- * File namer class.
- */
- 'file_namer' => DefaultFileNamer::class,
- /*
- * Path generator class.
- */
- 'path_generator' => DefaultPathGenerator::class,
- /*
- * File remover class.
- */
- 'file_remover_class' => DefaultFileRemover::class,
- /*
- * Custom path generators per model.
- */
- 'custom_path_generators' => [],
- /*
- * URL generator class.
- */
- 'url_generator' => DefaultUrlGenerator::class,
- /*
- * Moves media on update to keep path consistent.
- */
- 'moves_media_on_update' => false,
- /*
- * Version urls with ?v=xx query string.
- */
- 'version_urls' => false,
- /*
- * Image optimizers.
- */
- 'image_optimizers' => [
- // Left empty - optimization handled by project's ImageUpload service
- ],
- /*
- * Image generators.
- */
- 'image_generators' => [
- Image::class,
- Webp::class,
- Avif::class,
- Pdf::class,
- Svg::class,
- Video::class,
- ],
- /*
- * Temporary directory path for image conversions.
- */
- 'temporary_directory_path' => null,
- /*
- * Image driver: gd, imagick or vips.
- */
- 'image_driver' => env('IMAGE_DRIVER', 'gd'),
- /*
- * FFMPEG paths.
- */
- 'ffmpeg_path' => env('FFMPEG_PATH', '/usr/bin/ffmpeg'),
- 'ffprobe_path' => env('FFPROBE_PATH', '/usr/bin/ffprobe'),
- /*
- * FFMPEG timeout in seconds.
- */
- 'ffmpeg_timeout' => env('FFMPEG_TIMEOUT', 900),
- /*
- * FFMPEG threads.
- */
- 'ffmpeg_threads' => env('FFMPEG_THREADS', 0),
- /*
- * Jobs used by the package.
- */
- 'jobs' => [
- 'perform_conversions' => PerformConversionsJob::class,
- 'generate_responsive_images' => GenerateResponsiveImagesJob::class,
- ],
- /*
- * Media downloader used by addMediaFromUrl.
- */
- 'media_downloader' => DefaultDownloader::class,
- /*
- * SSL verification for remote media downloads.
- */
- 'media_downloader_ssl' => env('MEDIA_DOWNLOADER_SSL', true),
- /*
- * Default lifetime in minutes for temporary URLs.
- */
- 'temporary_url_default_lifetime' => env('MEDIA_TEMPORARY_URL_DEFAULT_LIFETIME', 5),
- 'remote' => [
- 'extra_headers' => [
- 'CacheControl' => 'max-age=604800',
- ],
- ],
- 'responsive_images' => [
- 'width_calculator' => FileSizeOptimizedWidthCalculator::class,
- 'use_tiny_placeholders' => true,
- 'tiny_placeholder_generator' => Blurred::class,
- ],
- /*
- * Enable Vapor uploads for Media Library Pro.
- */
- 'enable_vapor_uploads' => env('ENABLE_MEDIA_LIBRARY_VAPOR_UPLOADS', false),
- /*
- * Default loading attribute for img tags.
- */
- 'default_loading_attribute_value' => null,
- /*
- * Storage prefix for media.
- */
- 'prefix' => env('MEDIA_PREFIX', ''),
- /*
- * Force lazy loading.
- */
- 'force_lazy_loading' => env('FORCE_MEDIA_LIBRARY_LAZY_LOADING', true),
- ];
|