demo icon indicating copy to clipboard operation
demo copied to clipboard

Use spatie/laravel-medialibrary for all medias

Open wblondel opened this issue 1 year ago • 0 comments

Hello,

I noticed that spatie/laravel-medialibrary is only used for the shop Product model.

As a result, the storage/app/public folder is messy with a lot of images at the root.

In this PR:

  • Three (3) media collections are explicitly defined: product-images, link-images, and post-images;
  • Each media collection uses its own disk, defined in config/filesystems.php;
  • The post-images and link-images media collections are single file collections
  • The Filament resources were modified to get the images from the correct media collection
  • A thumb media conversion is defined for all media collections
  • The thumbnails are loaded on the Filament infolists / tables instead of the full images
  • The full images are loaded on the views / edit pages
  • The collections only accept image/jpeg files and this rule is enforced in Filament as well
  • Product images are reorderable
  • The blog_links.image and blog_posts.image fields are dropped

wblondel avatar Feb 13 '24 12:02 wblondel