Questions tagged [laravel-medialibrary]

Laravel-medialibrary is a popular Laravel package to associate media files with eloquent ORM models

Useful links:

105 questions
0
votes
1 answer

Eager Load media Url - laravel-medialibrary

I am trying to eager load all the logotype urls from Spatie's laravel-medialibrary: They are then going to used a json-response. Ideally I the library would work as follow: # Get all clients with url to logotype (small)` …
Line in Linus
  • 390
  • 8
  • 25
0
votes
1 answer

Unit testing Spatie laravel-medialibrary file upload

I'm having trouble getting a unit test working for file upload, and storing the file using Spatie's medialibrary. The code works fine in the browser: the file saves correctly. However, this unit test fails: Storage::fake('resource-files'); …
Erik
  • 1
  • 1
0
votes
1 answer

Spatie Media Library upload ALWAYS leads to "request does not have a file in a key named [...]"

I have installed Spatie Media Library exactly how it is described on their docs. However, every time I try to save a media file with addMediaFromRequest('keyName') I get this error: The current request does not have a file in a key named…
Jan
  • 1,180
  • 3
  • 23
  • 60
0
votes
1 answer

Cannot declare class Spatie\MediaLibrary\UrlGenerator\GcsUrlGenerator because the name is already in use

I'm having a problem with Spatie Media Library. I created my class to use a different filesystem (specifically a Google bucket). Everything works smooth and I can integrate the filesystem correctly, save and view through the custom url. I created my…
0
votes
0 answers

Laravel Medialibrary site is crashing with "This site can’t be reached"

I am building a site where a user can upload pdf files, I use spatie/Medialibrary for this task and an hour ago everythngi was working great. However, I needed to install imagick for thumbnail generation of pdf files. After successfully installing…
Matrix
  • 437
  • 5
  • 18
0
votes
0 answers

Image not showing in live hosting

I have used spatie media library package for uploading images in my laravel project . It was completely fine on localhost and it uploading and showing too . But in live server it is uploading but it is not showing . It kust show img icon and when I…
0
votes
0 answers

Can't upload image using Laravel and Spatie media library run by Laragon

I've been having this issue 3 days now. I already tried setting permission to full access to storage directory on windows explorer, run command chmod -R o+w storage but still no luck. On the other hand in my friend's dev environment using Homestead,…
claudios
  • 6,588
  • 8
  • 47
  • 90
0
votes
1 answer

Laravel - Publish Vendor Class Spatie\MediaLibrary\Models\Media in Spatie to configure it with MongoDB

here i have a Media class at Spatie\MediaLibrary\Models\Media path. it was creating PDO issues with this code. class Media extends Model implements Responsable, Htmlable so i tried this in there and it worked for the cause. use…
rameezmeans
  • 830
  • 1
  • 10
  • 21
0
votes
1 answer

spatie media library regenerate artisan command not working in job on production

I use spatie media library for one of my project. requirement is when uploaded image status is approved then generate conversions of that particular image. So, i write code for that in My Model is: public function registerMediaConversions(Media…
Jinal Somaiya
  • 1,931
  • 15
  • 29
0
votes
1 answer

Problem with uploading Image with bigger size (Application/octet-stream) - Laravel Media Library

I'm using Laravel Media Library by Spatie. Works perfectly on Local Machine, but whenever I try to upload an Image with size more than 2MB, it gives me the following error: Spatie \ MediaLibrary \ Exceptions \ FileCannotBeAdded \…
0
votes
1 answer

Spatie media library - The current request does not have a file in a key named `pic`

I'm using spaties media library to handle my images. I'm trying to allow a user to upload images in a multipart form. I'm getting this error when trying to progress on The current request does not have a file in a key named pic It's in the…
user9555022
0
votes
0 answers

Add custom VideoGenerator Laravel Spatie Media Library

Using Spatie media library in one of my projects, I want to add conversions of video. when video is uploaded then add other resolutions videos to that particular media conversions folder. //controller file video upload function public function…
Jinal Somaiya
  • 1,931
  • 15
  • 29
0
votes
1 answer

How does Laravel decide where to save temp files?

I am using this image library that uploads images to S3. At first it saves the image as a temp file on local machine, then it uploads it to S3. My issue is that using certain functions temp files get uploaded to C:\\xampp\\tmp/ and using other…
0
votes
0 answers

Laravel Spatie/Media with Voyager admin panel

I have the problem to make friends Spatie medialibrary with Voyager. When adding Bread to this table, there is a field called Model Name. If I fill it with model that implements HasMedia, the Bread has created successfully. But when browse 'media'…
-1
votes
3 answers

How to resolve Error Interface "Spatie\MediaLibrary\HasMedia" not found

I have installed Spatie Media Library in a Laravel 9 project. Following the document, I have set my User model to implement HasMedia and also use InteractsWithMedia like this
Mena
  • 1,873
  • 6
  • 37
  • 77
1 2 3 4 5 6
7