BRACKETS-by-TRIAD / craftable

Admin panel builder / CRUD generator for Laravel.
https://getcraftable.com
MIT License
984 stars 191 forks source link

Improve Media Library to use max fize size value from config #407

Open timoransky opened 2 years ago

timoransky commented 2 years ago

In our Media repository we extend spatie/laravel-medialibrary but our custom MediaCollection model is not taking into account value from config medialibrary.max_file_size. The only way to use it is for now to set the value in the collection itself like so:

public function registerMediaCollections() {
    $this->addMediaCollection('Example')
        ...
        ->maxFilesize(config('medialibrary.max_file_size'));
}

The point of this issue is to somehow use the config value as the default one.

Link to repository: BRACKETS-by-TRIAD/media