This is the documentation for
v8 but the latest version is
v10
.
You can switch versions in the menu on the left/at the top.
Check your current version with the following command:
composer show spatie/laravel-medialibrary
When you change a conversion on your model, all images that were previously generated will not be updated automatically. You can regenerate your images via an artisan command. Note that conversions are often queued, so it might take a while to see the effects of the regeneration in your application.
php artisan media-library:regenerate
If you only want to regenerate the images for a single model, you can specify it as a parameter:
php artisan media-library:regenerate "App\Post"
If you only want to regenerate images for a few specific media items, you can pass their IDs using the --ids
option:
php artisan media-library:regenerate --ids=1 --ids=2 --ids=3
A comma separated list of id's works too.
php artisan media-library:regenerate --ids=1,2,3
If you only want to regenerate images for one or many specific conversions, you can use the --only
option:
php artisan media-library:regenerate --only=thumb --only=foo
If you only want to regenerate missing images, you can use the --only-missing
option:
php artisan media-library:regenerate --only-missing