Go to file
philipp lang 77cfe9bbc7 Add Laravel 11 Support 2024-09-21 22:45:44 +02:00
assets Add slot for multiple buttons 2024-04-18 22:14:20 +02:00
config Add deferred upload 2024-01-03 15:47:41 +01:00
src Add Laravel 11 Support 2024-09-21 22:45:44 +02:00
tests Update Pest PHP 2024-09-21 17:13:38 +02:00
.gitignore Add icon to file 2023-03-10 12:47:14 +01:00
README.md Add MediaFile Helper 2024-01-03 00:47:05 +01:00
composer.json Add Laravel 11 Support 2024-09-21 22:45:44 +02:00
composer.lock Add Laravel 11 Support 2024-09-21 22:45:44 +02:00
phpunit.xml Update Pest PHP 2024-09-21 17:13:38 +02:00
testbench.yaml Add authroization with actual user 2024-01-03 13:42:29 +01:00

README.md

Laravel Medialibrary Helper

This package creates routes for the popular Medialibrary Package from Spatie ().

Available methods

In RegisterMediaCollections, you have the following methods available:

You can set a filename by default for the file. This accepts the associated Model, as well as the original basename (without extension). You should return the new name of the file without the extension (e.g. disc).

forceFileName(fn ($model, $path) => Str::slug($path))

You can set a max width (in Pixels) for images. This will resize the image BEFORE any normal Medialibrary conversions take place.

maxWidth(fn () => 2500)

You can call whatever you want after an image has been added, modified or deleted.

->after(function ($model) {
    ....
})