filament icon indicating copy to clipboard operation
filament copied to clipboard

fix: Set default maxSize on SpatieMediaLibraryFileUpload based on media-library configuration

Open dev opened this issue 10 months ago • 0 comments

Description

This PR adds a default maxSize setting to the SpatieMediaLibraryFileUpload component that automatically uses the value from the media-library configuration. The maxSize is now set to round(config('media-library.max_file_size') / 1000) by default. Currently, if developers forget to set maxSize manually, the media-library throws an exception when users try to upload files that exceed the size limit. By setting a default maxSize value that matches the media-library configuration, users will receive a validation error instead of an exception, which improves the user experience.

Visual changes

N/A

Functional changes

  • [x] Code style has been fixed by running the composer cs command.
  • [x] Changes have been tested to not break existing functionality.
  • [x] Documentation is up-to-date.

dev avatar Apr 22 '25 07:04 dev