Questions tagged [laravel-medialibrary]

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

Useful links:

105 questions
1
vote
1 answer

method addMediaFromUrl() from spatie not working

I want use spatie to get Google+ avatar, but when I try get it there is an error. $user = Socialite::driver('google')->user(); $usertest=User::whereEmail($user->getemail())->first(); if(! $usertest){ $usertest=User::create([ …
1
vote
1 answer

Laravel Spatie Media Library model_type doesn't have a default

i'm having trouble setting up Laravel with the Spatie Media Library package. Here is the error i'm getting: SQLSTATE[HY000]: General error: 1364 Field 'model_type' doesn't have a default value (SQL: insert into `images` (`updated_at`, `created_at`)…
1
vote
0 answers

Can we use the HasMediaTrait with a pivot class?

I am using this media library for Laravel. Lets say I have a Pivot class in Laravel 5.5 which is the intermediate table that joins two other tables in a many to many relation. I have implemented the class like this: class UserTask extends Pivot…
user3574492
  • 6,225
  • 9
  • 52
  • 105
0
votes
0 answers

How can I in spatie/laravel-medialibrary to keep info about youtube key?

In laravel 8 app using spatie/laravel-medialibrary 9 for storing of images and videos in adminarea I also use youtube keys (only key, not url) which can be attached for some item. If there is a way to store youtube key im media table of…
mstdmstd
  • 2,195
  • 17
  • 63
  • 140
0
votes
0 answers

Laravel 8, can't show the image but image got uploaded into database and local folder yet isn't shown?

i am using laravel 8 framework but can't seem to update my profile image. It always goes to fallback image when i am trying to update the image. enter image description here And here is my code profile.blade.php
0
votes
0 answers

How to add a conversion using laravel media library from only one of the multiple uploaded images

I'm uploading multiple images for a property and everything works well. The images and their conversions are uploaded successfully. However, a conversion is created for every image of a given property but I'd like to create a conversion only for the…
Alphy Gacheru
  • 489
  • 1
  • 9
  • 28
0
votes
0 answers

Media library is not retrieving images

Iam using Laravel spatie media library backage in my project: https://spatie.be/docs/laravel-medialibrary/v10/introduction The media library shows null when trying to retrieve an image from a model using the…
Zahraa
  • 67
  • 7
0
votes
2 answers

Laravel query orderBy has 'media' using Spatie\MediaLibrary

Im currently using the Spatie\MediaLibrary for my reviews model. I got a query getting all reviews but im trying to show reviews that has images first using orderBy. app\Models\Product.php Not working public function reviews():…
Tony Sawlwin
  • 146
  • 1
  • 19
0
votes
0 answers

Why won't my image display after pulling from SourceTree with spatie media library in Laravel?

I have a problem with the spatie media library where my image won't display after I pull it from a source tree. I don't know what the problem is. Is it a problem with spatie, or is it a problem with a source tree? Can someone help me with this?
0
votes
1 answer

How to add responsive images in webp format using laravel media library

I'm seeding responsive images as shown below and it working fine. How can I save the images in webp format regardless of the uploaded format? My run method public function run() { $seed_imgs_folder = 'http://127.0.0.1:8000/seed_imgs/'; …
Alphy Gacheru
  • 489
  • 1
  • 9
  • 28
0
votes
0 answers

Laravel Media library pro - Unchanged value of custom properties not persisting

Using custom properties with media library pro collection in Livewire, only changed values save. Existing, unchanged custom property values are deleted. If I change both properties, they save. If I change neither property, they remain saved. If I…
polycode
  • 135
  • 7
0
votes
0 answers

"spatie/laravel-medialibrary:^10.0.0" installing error

[ Problem 1 - spatie/image[2.2.2, ..., 2.2.5] require league/glide ^2.2.2 -> satisfiable by league/glide[2.2.2, 2.2.3]. - spatie/laravel-medialibrary[10.7.9, ..., 10.8.0] require maennchen/zipstream-php ^2.0 -> satisfiable by…
0
votes
0 answers

Spatie Image + Spatie Laravel Media Library. How to CROP an image

When an image is uploaded to my website it is stored using Laravel Media Library from Spatie. I have a conversion registered on the model and this works well to automatically create a cropped version of the uploaded image whilst also keeping the…
0
votes
0 answers

Configure Spatie Media Library plugin to upload to Digital Ocean

A bit of context, I'm working with Laravel Filament. I installed a plugin called Spatie Media Library, all good. Then, I created a DO Spaces bucket, add the CORS config, then in Laravel, I installed the required packages, added the disk with the…
Kenny Barrera
  • 172
  • 2
  • 14
0
votes
0 answers

Include package in my custom package laravel

Hi i'm trying to add spatie\laravel-medialibrary to my package to store media but it's not work the migration of "spatie\laravel-medialibrary" not published how can i publishe all config and migration for "spatie\laravel-medialibrary" from my…