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
Installs: 189
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/mlbrgn/laravel-medialibrary-extensions
Requires
- php: ^8.1 || ^8.2 || ^8.3
- blade-ui-kit/blade-icons: ^1.8
- davidhsianturi/blade-bootstrap-icons: ^2.1
- illuminate/support: ^10.0 || ^11.0 || ^12.0
- spatie/laravel-medialibrary: ^11.0
Requires (Dev)
- ext-gd: *
- barryvdh/laravel-ide-helper: ^3.0.0
- larastan/larastan: ^3.8.0
- laravel/pint: ^1.22
- orchestra/testbench: ^10.0.0
- orchestra/testbench-browser-kit: ^10.0.0
- pestphp/pest: ^4.0.0
- 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
- blade-ui-kit/blade-heroicons: Optional: SVG icons from Heroicons
- mlbrgn/imageeditor: Required for the image editor UI (install via npm or yarn).
- dev-main
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.0.37
- 1.0.36
- 1.0.35
- 1.0.34
- 1.0.33
- 1.0.32
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.1
- 1.0.0
- dev-release-please--branches--main--components--vendor/laravel-package
- dev-asset-versioning
- dev-plain-active-to-mle-active
- dev-bg-modal-effect
- dev-prefixing-css-classes
- dev-wageningen
This package is auto-updated.
Last update: 2025-11-27 00:26:00 UTC
README
This package adds functionality toMedia 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.
for the image editor to work the NPM package "@mlbrgn/media-library-extensions" needs to be installed.
Install
- Install the laravel package:
composer require mlbrgn/laravel-medialibrary-extensions
- Run install command
php artisan media-library-extensions:install
- add @import "media-library-extensions" to your app.js (or similar)
import {ImageEditor} from '@mlbrgn/media-library-extensions'
you can optionally set the path to the translations you want to use, but make sure the translations live in the path you specified.
NOTE: Don't forget to run "npm run build" for the image editor to be built!
ImageEditor.translationsPath = '/js/vendor/image-editor/lang';
The install command will publish assets, config, translation, views, and a policy. Also it will install the required @mlbrgn/media-library-extensions package
Manual install (without the install command)
You can also manually install by installing the @mlbrgn/media-library-extensions package
npm install @mlbrgn/media-library-extensions
And publish the required assets
php artisan vendor:publish --provider="Mlbrgn\MediaLibraryExtensions\Providers\MediaLibraryExtensionsServiceProvider" --tag="assets"
add @import for "media-library-extensions" to your app.js (or similar)
import {ImageEditor} from '@mlbrgn/media-library-extensions'
you can optionally set the path to the translations you want to use, but make sure the translations live in the path you specified.
NOTE: Don't forget to run "npm run build" for the imageeditor to be built!
ImageEditor.translationsPath = '/js/vendor/image-editor/lang';
Theme
The default themes are:
- plain
- bootstrap-5
Publishing
Several assets can be published:
- config
- views
- assets
- policy
- translations
to publish all assets:
php artisan vendor:publish --provider="Mlbrgn\MediaLibraryExtensions\Providers\MediaLibraryExtensionsServiceProvider" --tag="media-library-extensions-config"
to publish a single tag (group of assets):
php artisan vendor:publish --provider="Mlbrgn\MediaLibraryExtensions\Providers\MediaLibraryExtensionsServiceProvider" --tag="config"
Icons
For icons to work, you will have to install a Blade UIKit/Blade-icons package.
The package is configured to use 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
php artisan vendor:publish --tag=media-library-extensions-config php artisan vendor:publish --tag=media-library-extensions-views php artisan vendor:publish --tag=media-library-extensions-assets php artisan vendor:publish --tag=media-library-extensions-policy php artisan vendor:publish --tag=media-library-extensions-translations
Testing
This package uses Pest PHP for testing. For more information on how to write tests for this package, see the TESTING.md guide.