cloudinary-community / cloudinary-laravel

Laravel SDK for Cloudinary
MIT License
259 stars 70 forks source link

more x-cld-image component attributes and destination folder parameter in attach media #50

Open Tressos-Aristomenis opened 2 years ago

Tressos-Aristomenis commented 2 years ago

Hey, I have been struggling for hours and I still haven't found any solution with this one.

I can't find a way to add more attributes in x-cld-image. This is the component:

@php
 echo cloudinary()->getImageTag($publicId ?? '')->scale($width ?? '', $height ?? '')->serialize();
@endphp

Apparently, I can only add width and height but what if I want the image to be rounded? or change the file format?

Last but not least, I did $file->storeOnCloudinaryAs('logos', 'user_logo') to upload the file user_logo in the cloudinary folder logos and then I did $user->attachMedia($file) to attach the image to the specified user model. However, this resulted in having user_logo both in root cloudinary directory and in logos folder.

Maybe add another parameter to attachMedia , ie. folder so that we can choose destination folder for upload ?

unicodeveloper commented 2 years ago

@Tressos-Aristomenis is this something you still need?

royrakesh commented 1 year ago

It will be good if we can add attribute our own and it will merge into image tags Example

<x-cld-image public-id="{{$oldFeaturedImage->public_id}}" width="333" height="333" class="rounded-lg"></x-cld-image>