Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use spatie/laravel-medialibrary for all medias #97

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wblondel
Copy link
Contributor

@wblondel wblondel commented Feb 13, 2024

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 wblondel marked this pull request as ready for review February 13, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant