Questions tagged [laravel-medialibrary]

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

Useful links:

105 questions
2
votes
1 answer

Transparency support with PNGs in conversions for spatie/media-library

I am using spatie/media-library with my Laravel 8 project. In the model, I am writing a method to register a mediaCollection for a model. The issue I am facing is that during the conversion, the transparency is lost in the converted image. How can I…
Ehs4n
  • 762
  • 1
  • 8
  • 24
2
votes
1 answer

How to change image directory in spatie media library?

I'm new to this package since I usually use the image intervention. So the problem is whenever I save an image, it is saving in storage directory instead of in public directory. I tried to review the documentation and did some research and didn't…
Blues Clues
  • 1,694
  • 3
  • 31
  • 72
2
votes
1 answer

spatie/laravel-medialibrary change primary key

I'm using the package spatie/laravel-medialibrary and I want to change the primaryKey on their modal called Media, without editing the package src file. In my project, I'm using uuids as primary keys for all my models, so naturally, I want to do the…
Daniel R.
  • 629
  • 1
  • 10
  • 28
2
votes
1 answer

Error when using Spate Media Library: "BadMethodCallException Call to undefined method Illuminate\Foundation\Auth\User::addMediaFromRequest()"

This is my User Model namespace App; use Illuminate\Database\Eloquent\Model; use Spatie\MediaLibrary\HasMedia\HasMedia; use Spatie\MediaLibrary\HasMedia\HasMediaTrait; use Spatie\MediaLibrary\File; use…
Vlad
  • 33
  • 1
  • 6
2
votes
1 answer

laravel spatie/media library serving images from s3 with cloudfront

I tried to integrate spatie media library with S3 and cloudfront. But I couldn't get the images to serve through cloudfront cdn. Basically what I did was to set the AWS_URL to the Cloudfront url but when I check the image url it doesn't have the…
2
votes
2 answers

Laravel package error on file uploading using Spatie\MediaLibrary

i just try to upload the image to the server using Spatie\MediaLibrary package .Then laravel gives this error of not found function. I tried all the solution no one worked This is the code that i am using > public function update(Request…
Akshay
  • 127
  • 1
  • 6
2
votes
1 answer

How to update/edit custom_properties in laravel spatie?

I'm using laravel spatie in my app. I have a problem. When an user updates his list of image. Admin must to be approve a list of image which an user just update. If user add image, i just add more. But when an user change an image he had, how to do…
Ngoc Tran
  • 69
  • 2
  • 12
1
vote
2 answers

spatie/laravel-medialibrary - Ability to add conversion per media model "on the fly"?

I'm using popular package spatie/laravel-medialibrary for associating files with models. I was wondering if there is possibility add conversions on the fly, right before adding media to model. I tried something like this, but it seems like…
1
vote
0 answers

Spatie Media Library Generating Thumbnail from base64string

i've practiced as it is in the spatie media library v8 documentation, but it doesn't work when i use base64 files. In Controller: $mediaFile = request('image'); $filename = 'abcd.jpeg'; $product =…
1
vote
0 answers

How to add laravel-medialibrary into Laravel/mongodb app?

I need to add spatie/laravel-medialibrary 10 into Laravel 9 app with jenssegers/mongodb:^3.9 I modified model app/Models/CMSItem.php decalaration :
mstdmstd
  • 2,195
  • 17
  • 63
  • 140
1
vote
0 answers

Laravel - Saving Images To New Disk Returns 404 - How To Resolve (Laravel Media Library)

I have multiple disks set up within config/filesystems.php like so: I have recently added 'mealimages'. 'menus' => [ 'driver' => 'local', 'root' => storage_path('app/menus'), 'url' => env('APP_URL').'/menu-store', …
lky
  • 1,081
  • 3
  • 15
  • 31
1
vote
0 answers

Laravel Spatie Media Library AWS s3 bucket Access Denied

Uploading User profile photo & cover photo using Spatie Media Library on the AWS s3 bucket.I have set the s3 bucket policy to public and on \config\media-library.php i have set extra_headers [ 'ACL' => 'public-read' ]. So when I upload the images…
1
vote
1 answer

PHP requirement error when installing spatie-media-library-pro

I'm trying to install spatie/laravel-medialibrary-pro:^2.0.0 but hitting the error "- spatie/laravel-medialibrary-pro 2.0.0 requires php ^8.0 which does not match your installed version 7.4.14." My IDE is phpstorm which is using PHP 8.1. My…
rretzko
  • 41
  • 3
1
vote
1 answer

Error declaring MediaLibrary/CustomPathGenerator.php file

In laravel 9 with spatie/laravel-medialibrary 10 I tyry to make custom path for uploaded file looking at docs : https://spatie.be/docs/laravel-medialibrary/v9/advanced-usage/using-a-custom-directory-structure But making…
Petro Gromovo
  • 1,755
  • 5
  • 33
  • 91
1
vote
1 answer

Why the message don't appear on the page when MediaLibrary is used?

I'm using Laravel nova also the ClassicO\NovaMediaLibrary\MediaLibrary. And with Laravel Nova I can use the help method like this: Select::make('Option') ->options( Post::active() )->help( …
Ozzdev
  • 65
  • 1
  • 11