Questions tagged [laravel-medialibrary]

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

Useful links:

105 questions
6
votes
1 answer

Spatie Media Library - Delete originals after coversion

Is it possible to delete the original files after image conversion using Spatie Media Library (v7) - for example, the client uploads huge resolution files, but we only need them about 1000px wide and dont want to store the huge originals. Cheers in…
5
votes
1 answer

Composer version matching error laravel + spatie medialibrary

I try to create a new laravel app via the laravel installer with laravel new . This works without a problem. Once I try to install the spatie/medialibrary I get the following error that I cannot explain: $ composer require…
FMK
  • 1,062
  • 1
  • 14
  • 25
4
votes
3 answers

403 Forbidden error is received on file upload

I'm trying to upload a file in my Laravel 9 application. On the localhost, it works just fine, however, the same action fails when I try it from my application running on an Amazon Linux EC2. What I know: The action does not throw any exceptions,…
farjam
  • 2,089
  • 8
  • 40
  • 77
4
votes
1 answer

images not showing using spatie media library in Laravel 8

I am having trouble displaying the images uploaded using spatie media library. I already looked in their documentation but I can't find a solution. I had no issue uploading files (single file only). The Database Media Table Controller @…
SleepWalker
  • 613
  • 1
  • 12
  • 39
4
votes
0 answers

spatie medialibrary defining fallback image for each convertion

with spatie/medialibrary package i have 3 conversions in registerMediaConversions method like this public function registerMediaConversions(Media $media = null): void { $this->addMediaConversion('thumb') ->fit(MANIPULATIONS::FIT_STRETCH,…
4
votes
3 answers

Using spatie/media-library, how to rename a collection of uploaded files?

I would like to rename a collection of uploaded files, but when I use addAllMediaFromRequest() I can't retrieve information from the files. In this example; I need to know the file extension in order to rename the file. $files =…
Clément Baconnier
  • 5,718
  • 5
  • 29
  • 55
3
votes
0 answers

Problems with spatie laravel-media library using uuid

I am trying to use the spatie "laravel-media library 10" with laravel 9 and models using uuids. The media will be attached to the users. So my user class is : use Spatie\MediaLibrary\HasMedia; use Spatie\MediaLibrary\InteractsWithMedia; class User…
Dom
  • 2,984
  • 3
  • 34
  • 64
3
votes
0 answers

How to delete original file after converting image using spatie/media-library in Laravel

I am using Laravel 8 and I was wondering if there is anyway to automatically delete original image after it has converted in Spatie Media Library? it's currently taking up my storage space so I want to be able to delete original images. here's the…
TravelWhere
  • 327
  • 1
  • 5
  • 17
3
votes
1 answer

Laravel 7 : Interface 'Spatie\MediaLibrary\HasMedia' not found

I have this error while using the MediaLibrary package Interface 'Spatie\MediaLibrary\HasMedia' not found Trait 'Spatie\MediaLibrary\InteractsWithMedia' not found My project details :- php : 7.3.22 laravel : 7.28.3 I have tried follow the…
Beginner
  • 45
  • 1
  • 7
3
votes
1 answer

Spatie Medialibrary Custom Custom Directory As Prefix

I am using spatie/laravel-medialibrary:8.0. When I uploaded file, it was saved in storage/public directory. 1/filename.file_extension, 2/filename.file_extension... I think 1, 2... are ids of files. Is there any way to put different prefix directory…
user13621371
3
votes
1 answer

Using Cloudinary with spatie/media-library Laravel package

Is anyone using Laravel package spatie/media-library with Cloudinary? I thought implementing it would be trivial with flysystem. I'm actually using Cloudinary as a Nova field with silvanite/nova-field-cloudinary and it works great but I have a need…
praxus
  • 488
  • 1
  • 7
  • 18
3
votes
4 answers

Laravel Nova + Spatie Media library

Trying to use Laravel Nova with Spatie Media Library. I created upload field like this: Image::make('Logo') ->store(function (Request $request, $model) { $model->addMediaFromRequest('logo')->toMediaCollection('manufacturers'); …
RomkaLTU
  • 3,683
  • 8
  • 40
  • 63
3
votes
2 answers

Variable properties on a variable method

I'm using a third-party package which manipulates images. For basic conversions it accepts a single value: $image = $this->addMediaConversion('thumb'); $image->width(100); $image->height(100); The system I am building has a level of abstraction…
Mike
  • 8,767
  • 8
  • 49
  • 103
2
votes
1 answer

Call to undefined method Whitecube\NovaFlexibleContent\Layouts\Layout::getMedia()

I'm a bit stuck wondering what I'm doing wrong. I'm trying to use the spatie/laravel-medialibrary & ebess/advanced-nova-media-library together with nova-flexible-content In nova it works wonderful but can't get the image show in my blade. If anybody…
2
votes
2 answers

How in spatie/laravel-medialibrary get dimensions of uploaded image?

Using spatie/laravel-medialibrary 8 in Laravel 8 app I wonder if there is a way to get dimensions(width*height) of uploaded image? Thanks in advance!
Petro Gromovo
  • 1,755
  • 5
  • 33
  • 91
1
2 3 4 5 6 7