Skip to content

MediasUploaderConfig ​

Class: Unusualify\Modularous\Http\ViewComposers\MediasUploaderConfig
Source: src/Http/ViewComposers/MediasUploaderConfig.php

Builds and injects the media-library upload configuration object into every view. The frontend image/media uploader reads $mediasUploaderConfig to know where and how to upload media files. Mirrors FilesUploaderConfig but targets the media library instead of the file library.

Injected Variable ​

VariableTypeDescription
mediasUploaderConfigarrayComplete upload configuration for the media library

Config Object Shape ​

KeySourceDescription
endpointTypemedia_library.endpoint_typeStorage backend: local, s3, or azure
endpointResolved by endpointTypeThe URL the uploader POSTs media files to
successEndpointmedia-library.media.store routeAlways the local store route — used for the post-upload success callback
signatureEndpointmedia-library.sign-s3-upload or sign-azure-upload routePre-signed URL endpoint; null for local
endpointBucketfilesystems.disks.{disk}.bucketS3/Azure bucket name; 'none' when absent
endpointRegionfilesystems.disks.{disk}.regionS3 region; 'none' when absent
endpointRootfilesystems.disks.{disk}.rootRoot path prefix; empty string for local
accessKeyfilesystems.disks.{disk}.keyStorage access key; 'none' when absent
csrfTokenSession tokenLaravel CSRF token for request validation
aclmedia_library.aclS3/Azure ACL policy (e.g. public-read)
filesizeLimitmedia_library.filesize_limitMaximum upload size in bytes
allowedExtensionsmedia_library.allowed_extensionsArray of permitted media extensions

Endpoint Resolution by Type ​

endpointTypeendpointsignatureEndpoint
localmedia-library.media.store route URLnull
s3s3Endpoint($libraryDisk) helpermedia-library.sign-s3-upload route URL
azureazureEndpoint($libraryDisk) helpermedia-library.sign-azure-upload route URL

Difference from FilesUploaderConfig ​

MediasUploaderConfig reads from media_library.* config keys and targets the media-library.* admin routes. FilesUploaderConfig reads from file_library.* and targets file-library.* routes. Both produce the same shape of configuration object.

Configuration ​

php
// config/modularous.php
'media_library' => [
    'disk'               => 's3',
    'endpoint_type'      => 's3',       // 'local' | 's3' | 'azure'
    'allowed_extensions' => ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg'],
    'acl'                => 'public-read',
    'filesize_limit'     => 52428800,   // 50 MB in bytes
],