mlbrgn / laravel-medialibrary-extensions
Extensions designed for use with the Media Library package by Spatie. Adds a single image uploader, multiple image uploader and a modal with carousel
Package info
github.com/MLBRGN/laravel-medialibrary-extensions
pkg:composer/mlbrgn/laravel-medialibrary-extensions
Requires
- php: ^8.1 || ^8.2 || ^8.3
- ext-fileinfo: *
- ext-gd: *
- blade-ui-kit/blade-icons: ^1.8
- davidhsianturi/blade-bootstrap-icons: ^2.1
- illuminate/support: ^10 || ^11 || ^12 || ^13
- intervention/image: ^3.0
- intervention/image-laravel: ^1.0
- spatie/laravel-medialibrary: ^11.0
Requires (Dev)
- barryvdh/laravel-ide-helper: ^3.0.0
- larastan/larastan: ^3.8.0
- laravel/pint: ^1.22
- mlbrgn/laravel-form-components: ^1.0
- orchestra/testbench: ^10.0.0
- orchestra/testbench-browser-kit: ^10.0.0
- pestphp/pest: ^4.0.0
- pestphp/pest-plugin-browser: dev-fix/multipart-form-parser
- pestphp/pest-plugin-drift: ^4.0.0
- pestphp/pest-plugin-type-coverage: ^4.0.0
- spatie/laravel-translatable: ^6.0.0
- symfony/dom-crawler: ^7.0.0
Suggests
- ext-pdo_sqlite: Required for the Media Library Extensions demo database.
- blade-ui-kit/blade-heroicons: Optional: SVG icons from Heroicons
- mlbrgn/imageeditor: Required for the image editor UI (install via npm or yarn).
This package is auto-updated.
Last update: 2026-08-24 06:45:21 UTC
README
This package adds functionality to the Media Library package by Spatie:
- Providing a view to upload multiple media
- Providing a view to upload single media
Requirements
This package assumes that spatie/laravel-medialibrary is installed and its default migration has been run to create the media table.
Installation
- Install the package using:
composer require mlbrgn/laravel-medialibrary-extensions
- Run install command
php artisan medialibrary-extensions:install
You can configure the path to the translations the Image Editor, provided by this package, uses by adding the following to your app.js (or similar).
ImageEditor.translationsPath = '/js/vendor/image-editor/lang';
The install command will publish the needed assets, config, translation, views, and a policy.
Manual install (without using the install command)
You can also manually install by installing the @mlbrgn/laravel-medialibrary-extensions package
npm install @mlbrgn/laravel-medialibrary-extensions
And publish the required assets
php artisan vendor:publish --provider="Mlbrgn\MediaLibraryExtensions\Providers\MediaLibraryExtensionsServiceProvider" --tag="medialibrary-extensions-assets"
Themes
The provided themes are:
- plain (vanilla css and js)
- bootstrap-5
Publishing
Several assets can be published:
- config
- views
- assets
- policy
- translations
to publish all package assets:
php artisan vendor:publish --provider="Mlbrgn\MediaLibraryExtensions\Providers\MediaLibraryExtensionsServiceProvider"
to publish a single tag (group of assets):
php artisan vendor:publish --tag=medialibrary-extensions-config php artisan vendor:publish --tag=medialibrary-extensions-views php artisan vendor:publish --tag=medialibrary-extensions-assets php artisan vendor:publish --tag=medialibrary-extensions-images php artisan vendor:publish --tag=medialibrary-extensions-translations
Icons
For icons to work, you will have to install a Blade UI Kit package.
The package is configured to use the Blade Bootstrap Icons by default. To display them properly install
composer require davidhsianturi/blade-bootstrap-icons
You can override the icons in the published configuration file of this package and install another Blade UIKit/Blade-icons package
Testing
This package uses Pest PHP for testing. For more information on how to write tests for this package, see the TESTING.md guide.
If snapshot output changes intentionally, update snapshots with:
composer test -- --update-snapshots