Extra features for spatie/laravel-medialibrary package
This package provides extra features built on top of the spatie/laravel-medialibrary package.
The extension package will follow the original package compatibilities and upgrades.
However, the minor and patch version numbers may differ, according to the feature additions or bug fixes required by this package.
Find the complete package documentation here : https://docs.spatie.be/laravel-medialibrary/v7.
This extension package is a fork from the original spatie/laravel-medialibrary one.
As so, you should uninstall the original package if you installed it to avoid conflicts :
composer remove spatie/laravel-medialibrary
Then, install the extension package via composer :
composer require "okipa/laravel-medialibrary-ext:^7.0"
Follow the original package installation instructions :
- https://github.com/spatie/laravel-medialibrary#installation
- https://docs.spatie.be/laravel-medialibrary/v7/installation-setup
Finally, you can publish the extension translation files if needed with :
php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="translations"
This feature is now part of the original package.
This feature is now part of the original package.
Declare your media validation constraints in a breeze with validationConstraints(string $collectionName): string
.
// in your user storing form request for example
public function rules()
{
return [
'avatar' => (new User)->validationConstraints('avatar'),
// your other validation rules
];
}
// rendering example : `dimensions:min_width=60,min_height=20|mimetypes:image/jpeg,image/png`
Easily add legends under your media inputs with constraintsLegend(string $collectionName): string
.
<!-- in your HTML form -->
<label for="avatar">Choose a profile picture :</label>
<input type=" id="avatar" name="avatar" value="{{ $avatarFileName }}">
<small>{{ (new User)->constraintsLegend('avatar') }}</small>
<!-- Rendering example : `Min. width : 150 px / Min. height : 70 px. Accepted MIME Type(s) : image/jpeg, image/png.` -->
Manage the global conversions queued status by setting a boolean value to MEDIALIBRARY_QUEUED_CONVERSIONS
in your.env
file, or directly to config('medialibrary.queued_conversions')
if you published the package config file.
This will set the default queued status for all your defined conversions.
You still will be able to manually define a specific queued status for a conversion.
composer test
Please see CHANGELOG for more information about what has changed recently.
Please see CONTRIBUTING for details.
- Arthur LORENT (Extension maintainer)
- Freek Van der Herten (Package creator and maintainer)
- All Contributors
The MIT License (MIT). Please see License File for more information.