Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for folders/directory #4

Open
m2de opened this issue Nov 9, 2018 · 5 comments
Open

Support for folders/directory #4

m2de opened this issue Nov 9, 2018 · 5 comments
Labels
enhancement New feature or request

Comments

@m2de
Copy link
Contributor

m2de commented Nov 9, 2018

Originally posted by @Sunil-Kis in #1 (comment)

@m2de m2de added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Nov 9, 2018
@reganjohnson
Copy link

Interested in this as well - thanks for the package.

@aurawindsurfing
Copy link

That would be nice addition please

@eithed
Copy link

eithed commented Jun 12, 2019

I've added support for folders in this fork: https://github.com/eithed/nova-field-cloudinary

Then, all that is needed is definition of Field class to write into a specific folder on Cloudinary (in my case the folder path is defined via .env). This can be defined in the project itself:

<?php

namespace App\Nova\Fields;

use Silvanite\NovaFieldCloudinary\Fields\CloudinaryImage;

class Image extends CloudinaryImage
{
    public function __construct($name, $attribute = null, $disk = 'cloudinary', $storageCallback = null)
    {
        $this->storagePath = '/'.config('filesystems.disks.cloudinary.cloud_folder');

        parent::__construct($name, $attribute, $disk, $storageCallback);
    }
}

Probably one could go and extend CloudinaryImage class to have a setOptions method where options could be passed to Cloudinary\Uploader (so, one could affect other Cloudinary options), but I failed to find how to access the field in the CloudinaryAdapter::writeStream where the upload takes place and League\Flysystem\Filesystem doesn't strike me as easily extendable to support this (maybe through League\Flysystem\Config). But, as I needed just folders support, this does the trick.

@prestontoor
Copy link

Any idea when a patch for this will be available so we can use a folder?

@lukebouch
Copy link
Collaborator

@prestontoor I have taken over maintaining this package. I will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants