Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ligonsker's avatar

Intervention or Spatie Laravel-MediaLibrary (or both)?

Hello,

I want to allow users to upload images/videos and then display thumbnails in a page (and also allow users to download the original media that was uploaded)

At first I was looking at Intervention, then I found out about Spatie Laravel-medialibrary.

But I am not sure if I should use both? How exactly can Spatie Laravel-medialibrary help in this case? Something that intervention doesn't do?

How would associating models to files help me here (as in the Spatie package), and will it work in my use case where each user has his own media folder?

Update: If I understand correctly I do not need Spatie package here because it's not that I associate some single image (like profile picture) to a User model for example, but I just upload mass files so it's not for that purpose?

0 likes
2 replies
tykus's avatar

Spatie's MediaLibrary package allows you to upload and associate one or many media files to be associated with each Model instance. The video plugin allows you to define a manupulation which extracts a still image to represent a video.

On the storage aspect (each user having their own folder), you can implement your own PathGenerator class which allows you to define where the media should be stored.

1 like
Ligonsker's avatar

@tykus Is there any scenario where it helps me in my situation over just using Intervention Image?

Please or to participate in this conversation.