trait EditTrait

Trait EditTrait

Properties

ApiClient $apiClient Defined in UploadApi class

Methods

destroyAsync(string $publicId, array $options = [])

Immediately and permanently deletes a single asset from your Cloudinary cloud.

destroy(string $publicId, array $options = [])

Immediately and permanently deletes a single asset from your Cloudinary cloud.

renameAsync(string $fromPublicId, string $toPublicId, array $options = [])

Renames the specified asset in your Cloudinary cloud.

rename(string $fromPublicId, string $toPublicId, array $options = [])

Renames the specified asset in your Cloudinary cloud.

explicitAsync(string $publicId, array $options = [])

Applies actions to an already uploaded asset.

explicit(string $publicId, array $options = [])

Applies actions to already uploaded assets.

updateMetadataAsync(array $metadata, array $publicIds, array $options)

Populates metadata fields with the given values. Existing values will be overwritten.

updateMetadata(array $metadata, array $publicIds, array $options = [])

Populates metadata fields with the given values.

Details

PromiseInterface destroyAsync(string $publicId, array $options = [])

Immediately and permanently deletes a single asset from your Cloudinary cloud.

Backed up assets are not deleted, and any assets and transformed assets already downloaded by visitors to your website might still be accessible through cached copies on the CDN. You can invalidate any cached copies on the CDN with the invalidate parameter.

This is an asynchronous function.

Parameters

Name Type Description
$publicId string The public ID of the asset to delete.
$options array The optional parameters. See the upload API documentation.

Return Value

PromiseInterface

See also

https://cloudinary.com/documentation/image_upload_api_reference#destroy_method

ApiResponse destroy(string $publicId, array $options = [])

Immediately and permanently deletes a single asset from your Cloudinary cloud.

Backed up assets are not deleted, and any assets and transformed assets already downloaded by visitors to your website might still be accessible through cached copies on the CDN. You can invalidate any cached copies on the CDN with the invalidate parameter.

Parameters

Name Type Description
$publicId string The public ID of the asset to delete.
$options array The optional parameters. See the upload API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/image_upload_api_reference#destroy_method

PromiseInterface renameAsync(string $fromPublicId, string $toPublicId, array $options = [])

Renames the specified asset in your Cloudinary cloud.

The existing URLs of renamed assets and their associated derived assets are no longer valid, although any assets and transformed assets already downloaded by visitors to your website might still be accessible through cached copies on the CDN. You can invalidate any cached copies on the CDN with the invalidate parameter.

This is an asynchronous function.

Parameters

Name Type Description
$fromPublicId string The public ID of the asset to rename.
$toPublicId string The new public ID of the asset.
$options array The optional parameters. See the upload API documentation.

Return Value

PromiseInterface

See also

https://cloudinary.com/documentation/image_upload_api_reference#rename_method

mixed rename(string $fromPublicId, string $toPublicId, array $options = [])

Renames the specified asset in your Cloudinary cloud.

The existing URLs of renamed assets and their associated derived assets are no longer valid, although any assets and transformed assets already downloaded by visitors to your website might still be accessible through cached copies on the CDN. You can invalidate any cached copies on the CDN with the invalidate parameter.

Parameters

Name Type Description
$fromPublicId string The public ID of the asset to rename.
$toPublicId string The new public ID of the asset.
$options array The optional parameters. See the upload API documentation.

Return Value

mixed

See also

https://cloudinary.com/documentation/image_upload_api_reference#rename_method

PromiseInterface explicitAsync(string $publicId, array $options = [])

Applies actions to an already uploaded asset.

This is an asynchronous function.

Parameters

Name Type Description
$publicId string The public ID of the asset to apply the actions to.
$options array The optional parameters. See the upload API documentation.

Return Value

PromiseInterface

See also

https://cloudinary.com/documentation/image_upload_api_reference#explicit_method

mixed explicit(string $publicId, array $options = [])

Applies actions to already uploaded assets.

Parameters

Name Type Description
$publicId string The public ID of the asset to apply the actions to.
$options array The optional parameters. See the upload API documentation.

Return Value

mixed

See also

https://cloudinary.com/documentation/image_upload_api_reference#explicit_method

mixed updateMetadataAsync(array $metadata, array $publicIds, array $options)

Populates metadata fields with the given values. Existing values will be overwritten.

Any metadata-value pairs given are merged with any existing metadata-value pairs (an empty value for an existing metadata field clears the value).

This is an asynchronous function.

Parameters

Name Type Description
$metadata array A list of custom metadata fields (by external_id) and the values to assign to each of them.
$publicIds array An array of Public IDs of assets uploaded to Cloudinary.
$options array The optional parameters. See the upload API documentation.

Return Value

mixed A list of public IDs that were updated.

See also

https://cloudinary.com/documentation/image_upload_api_reference#metadata_method

mixed updateMetadata(array $metadata, array $publicIds, array $options = [])

Populates metadata fields with the given values.

Existing values will be overwritten.

Any metadata-value pairs given are merged with any existing metadata-value pairs (an empty value for an existing metadata field clears the value).

Parameters

Name Type Description
$metadata array A list of custom metadata fields (by external_id) and the values to assign to each of them.
$publicIds array An array of Public IDs of assets uploaded to Cloudinary.
$options array The optional parameters. See the upload API documentation.

Return Value

mixed A list of public IDs that were updated.

See also

https://cloudinary.com/documentation/image_upload_api_reference#metadata_method