-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add support for folders #12
Conversation
Hi. Thanks very much for your contribution. I will try and pull this into a couple of projects when I get a chance to test it out but all looks good as far as I can tell without trying it. |
Any chance this can get merged soon? |
|
||
$options = ['public_id' => $path, 'resource_type' => 'auto']; | ||
|
||
if ($folder != '.') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does pathinfo
always return a .
for dirname if the file is in the cwd?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I remember, yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at https://www.php.net/manual/en/function.dirname.php this could be a .
/
or \
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I was running it on mac (or Heroku) it was .
. I don't have access to Windows machine to check what happens there
Have not yet had a chance to fully test this. Can anyone confirm if this works with nested folders? IIRC there are some limitations on Cloudinary but there is no validation going on here. Does Cloudinary throw an error and we don't need to worry about additional validation or will things just not work as expected. Happy to merge if someone can clarify some of these edge cases. |
We're currently using this approach and it does work for nested folders; indeed there's no validation, but I don't think it's required as all it's doing is passing additional parameters straight into Cloudinary PHP package, but I do admit that I've not tested what will happen if I'll try to upload file into |
Hi, any update about this PR ? I would be interested by this feature :) |
Try to check out #16 for an implementation of not only folders but all the optional parameters. |
Per #4
This will allow users to define what folder on Cloudinary given field should upload to. While default folder where the file is stored is set to be '/' in
Laravel\Nova\Fields\File
($storagePath), one can override this behaviour by extendingCloudinaryImage
and defining$storagePath
within the constructor.