Skip to content

FilesUploaderConfig ​

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

Builds and injects the file-library upload configuration object into every view. The frontend file uploader (Filepond or equivalent) reads $filesUploaderConfig to know where and how to upload files.

Injected Variable ​

VariableTypeDescription
filesUploaderConfigarrayComplete upload configuration for the file library

Config Object Shape ​

KeySourceDescription
endpointTypefile_library.endpoint_typeStorage backend: local, s3, or azure
endpointResolved by endpointTypeThe URL the uploader POSTs files to
successEndpointfile-library.file.store routeAlways the local store route — used for the post-upload success callback
signatureEndpointfile-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
aclfile_library.aclS3/Azure ACL policy (e.g. public-read)
filesizeLimitfile_library.filesize_limitMaximum upload size in bytes
allowedExtensionsfile_library.allowed_extensionsArray of permitted file extensions

Endpoint Resolution by Type ​

endpointTypeendpointsignatureEndpoint
localfile-library.file.store route URLnull
s3s3Endpoint($libraryDisk) helperfile-library.sign-s3-upload route URL
azureazureEndpoint($libraryDisk) helperfile-library.sign-azure-upload route URL

Configuration ​

php
// config/modularous.php
'file_library' => [
    'disk'               => 'local',
    'endpoint_type'      => 'local',    // 'local' | 's3' | 'azure'
    'allowed_extensions' => ['pdf', 'doc', 'docx', 'xls', 'xlsx'],
    'acl'                => 'private',
    'filesize_limit'     => 10485760,   // 10 MB in bytes
],