PHP Class JD\Cloudder\CloudinaryWrapper

Show file Open project: jrm2k6/cloudder Class Usage Examples

Protected Properties

Property Type Description
$cloudinary Cloudinary Cloudinary lib.
$config Illuminate\Config\Repository Repository config.
$uploadedResult array Uploaded result.
$uploader Cloudinary\Uploader Cloudinary uploader.

Public Methods

Method Description
__construct ( Illuminate\Config\Repository $config, Cloudinary $cloudinary, Uploader $uploader, Api $api ) : void Create a new cloudinary instance.
addTag ( string $tag, array $publicIds = [], array $options = [] ) Add tag to images.
createArchive ( array $options = [], $nameArchive = null, string $mode = 'create' ) Create a zip file containing images matching options.
createTransformation ( string $name, string $definition, array $options = [] ) : array Create transformation
createUploadMapping ( string $name, array $options = [] ) : array Create upload mapping
createUploadPreset ( string $name, array $options = [] ) : array Create upload preset
delete ( $publicId, $options = [] ) : array Alias of destroy.
deleteAllResources ( array $options = [] ) : null Destroy all resources from Cloudinary
deleteDerivedResources ( array $publicIds = [], array $options = [] ) : null Delete transformed images by IDs
deleteResources ( array $publicIds, array $options = [] ) : null Destroy images from Cloudinary
deleteResourcesByPrefix ( string $prefix, array $options = [] ) : null Destroy a resource by its prefix
deleteResourcesByTag ( string $tag, array $options = [] ) : null Delete all resources from one tag
deleteTransformation ( string $transformation, array $options = [] ) : array Delete single transformation
deleteUploadMapping ( string $name, array $options = [] ) : array Delete upload mapping
deleteUploadPreset ( string $name, array $options = [] ) : array Delete upload preset
destroy ( string $publicId, array $options = [] ) : array Destroy resource from Cloudinary
destroyImage ( string $publicId, array $options = [] ) : array Alias for destroy
destroyImages ( array $publicIds, array $options = [] ) : null Alias for deleteResources
downloadArchiveUrl ( array $options = [], $nameArchive = null ) Download a zip file containing images matching options.
getApi ( ) : Api Get cloudinary api
getCloudinary ( ) : Cloudinary Get cloudinary class.
getPublicId ( ) : string Uploaded public ID.
getResult ( ) : array Uploaded result.
getUploader ( ) : Uploader Get cloudinary uploader.
ping ( array $options = [] ) : array Ping cloudinary servers
privateDownloadUrl ( string $publicId, string $format, array $options = [] ) : string Display private image
removeTag ( string $tag, array $publicIds = [], array $options = [] ) Remove tag from images.
rename ( string $publicId, string $toPublicId, array $options = [] ) : array Rename public ID.
replaceTag ( string $tag, array $publicIds = [], array $options = [] ) Replace image's tag.
resource ( string $publicId, array $options = [] ) : array Display a resource
resources ( array $options = [] ) : array Show Resources
resourcesByIds ( array $options = [] ) : array Show Resources by id
resourcesByModeration ( string $kind, string $status, $options = [] ) : array Show Resources by moderation status
resourcesByTag ( string $tag, $options = [] ) : array Show Resources by tag name
restore ( array $publicIds = [], array $options = [] ) : null Restore a resource
rootFolders ( array $options = [] ) : array List Root folders
secureShow ( string $publicId, array $options = [] ) : string Display resource through https.
show ( string $publicId, array $options = [] ) : string Display resource through https.
showPrivateUrl ( string $publicId, string $format, array $options = [] ) : string Alias for privateDownloadUrl
subfolders ( string $name, array $options = [] ) : array List subfolders
tags ( array $options = [] ) : array Display tags list
transformation ( string $transformation, array $options = [] ) : array List single transformation
transformations ( array $options = [] ) : array List transformations
update ( string $publicId, array $options = [] ) : array Updates a resource
updateTransformation ( string $transformation, array $updates = [], array $options = [] ) : array Update single transformation
updateUploadMapping ( string $name, array $options = [] ) : array Update upload mapping
updateUploadPreset ( string $name, array $options = [] ) : array Update upload preset
upload ( mixed $source, string $publicId = null, array $uploadOptions = [], array $tags = [] ) : CloudinaryWrapper Upload image to cloud.
uploadMapping ( string $name, array $options = [] ) : array Get upload mapping
uploadMappings ( array $options = [] ) : array List Upload Mappings
uploadPreset ( string $name, array $options = [] ) : array Get upload mapping
uploadPresets ( array $options = [] ) : array List Upload Presets
uploadVideo ( mixed $source, string $publicId = null, array $uploadOptions = [], array $tags = [] ) : CloudinaryWrapper Upload video to cloud.
usage ( array $options = [] ) : array Get usage details

Method Details

__construct() public method

Create a new cloudinary instance.
public __construct ( Illuminate\Config\Repository $config, Cloudinary $cloudinary, Uploader $uploader, Api $api ) : void
$config Illuminate\Config\Repository
$cloudinary Cloudinary
$uploader Cloudinary\Uploader
$api Cloudinary\Api
return void

addTag() public method

Add tag to images.
public addTag ( string $tag, array $publicIds = [], array $options = [] )
$tag string
$publicIds array
$options array

createArchive() public method

Create a zip file containing images matching options.
public createArchive ( array $options = [], $nameArchive = null, string $mode = 'create' )
$options array
$mode string

createTransformation() public method

Create transformation
public createTransformation ( string $name, string $definition, array $options = [] ) : array
$name string
$definition string
$options array
return array

createUploadMapping() public method

Create upload mapping
public createUploadMapping ( string $name, array $options = [] ) : array
$name string
$options array
return array

createUploadPreset() public method

Create upload preset
public createUploadPreset ( string $name, array $options = [] ) : array
$name string
$options array
return array

delete() public method

Alias of destroy.
public delete ( $publicId, $options = [] ) : array
return array

deleteAllResources() public method

Destroy all resources from Cloudinary
public deleteAllResources ( array $options = [] ) : null
$options array
return null

deleteDerivedResources() public method

Delete transformed images by IDs
public deleteDerivedResources ( array $publicIds = [], array $options = [] ) : null
$publicIds array
$options array
return null

deleteResources() public method

Destroy images from Cloudinary
public deleteResources ( array $publicIds, array $options = [] ) : null
$publicIds array
$options array
return null

deleteResourcesByPrefix() public method

Destroy a resource by its prefix
public deleteResourcesByPrefix ( string $prefix, array $options = [] ) : null
$prefix string
$options array
return null

deleteResourcesByTag() public method

Delete all resources from one tag
public deleteResourcesByTag ( string $tag, array $options = [] ) : null
$tag string
$options array
return null

deleteTransformation() public method

Delete single transformation
public deleteTransformation ( string $transformation, array $options = [] ) : array
$transformation string
$options array
return array

deleteUploadMapping() public method

Delete upload mapping
public deleteUploadMapping ( string $name, array $options = [] ) : array
$name string
$options array
return array

deleteUploadPreset() public method

Delete upload preset
public deleteUploadPreset ( string $name, array $options = [] ) : array
$name string
$options array
return array

destroy() public method

Destroy resource from Cloudinary
public destroy ( string $publicId, array $options = [] ) : array
$publicId string
$options array
return array

destroyImage() public method

Alias for destroy
public destroyImage ( string $publicId, array $options = [] ) : array
$publicId string
$options array
return array

destroyImages() public method

Alias for deleteResources
public destroyImages ( array $publicIds, array $options = [] ) : null
$publicIds array
$options array
return null

downloadArchiveUrl() public method

Download a zip file containing images matching options.
public downloadArchiveUrl ( array $options = [], $nameArchive = null )
$options array

getApi() public method

Get cloudinary api
public getApi ( ) : Api
return Cloudinary\Api

getCloudinary() public method

Get cloudinary class.
public getCloudinary ( ) : Cloudinary
return Cloudinary

getPublicId() public method

Uploaded public ID.
public getPublicId ( ) : string
return string

getResult() public method

Uploaded result.
public getResult ( ) : array
return array

getUploader() public method

Get cloudinary uploader.
public getUploader ( ) : Uploader
return Cloudinary\Uploader

ping() public method

Ping cloudinary servers
public ping ( array $options = [] ) : array
$options array
return array

privateDownloadUrl() public method

Display private image
public privateDownloadUrl ( string $publicId, string $format, array $options = [] ) : string
$publicId string
$format string
$options array
return string

removeTag() public method

Remove tag from images.
public removeTag ( string $tag, array $publicIds = [], array $options = [] )
$tag string
$publicIds array
$options array

rename() public method

Rename public ID.
public rename ( string $publicId, string $toPublicId, array $options = [] ) : array
$publicId string
$toPublicId string
$options array
return array

replaceTag() public method

Replace image's tag.
public replaceTag ( string $tag, array $publicIds = [], array $options = [] )
$tag string
$publicIds array
$options array

resource() public method

Display a resource
public resource ( string $publicId, array $options = [] ) : array
$publicId string
$options array
return array

resources() public method

Show Resources
public resources ( array $options = [] ) : array
$options array
return array

resourcesByIds() public method

Show Resources by id
public resourcesByIds ( array $options = [] ) : array
$options array
return array

resourcesByModeration() public method

Show Resources by moderation status
public resourcesByModeration ( string $kind, string $status, $options = [] ) : array
$kind string
$status string
return array

resourcesByTag() public method

Show Resources by tag name
public resourcesByTag ( string $tag, $options = [] ) : array
$tag string
return array

restore() public method

Restore a resource
public restore ( array $publicIds = [], array $options = [] ) : null
$publicIds array
$options array
return null

rootFolders() public method

List Root folders
public rootFolders ( array $options = [] ) : array
$options array
return array

secureShow() public method

Display resource through https.
public secureShow ( string $publicId, array $options = [] ) : string
$publicId string
$options array
return string

show() public method

Display resource through https.
public show ( string $publicId, array $options = [] ) : string
$publicId string
$options array
return string

showPrivateUrl() public method

Alias for privateDownloadUrl
public showPrivateUrl ( string $publicId, string $format, array $options = [] ) : string
$publicId string
$format string
$options array
return string

subfolders() public method

List subfolders
public subfolders ( string $name, array $options = [] ) : array
$name string
$options array
return array

tags() public method

Display tags list
public tags ( array $options = [] ) : array
$options array
return array

transformation() public method

List single transformation
public transformation ( string $transformation, array $options = [] ) : array
$transformation string
$options array
return array

transformations() public method

List transformations
public transformations ( array $options = [] ) : array
$options array
return array

update() public method

Updates a resource
public update ( string $publicId, array $options = [] ) : array
$publicId string
$options array
return array

updateTransformation() public method

Update single transformation
public updateTransformation ( string $transformation, array $updates = [], array $options = [] ) : array
$transformation string
$updates array
$options array
return array

updateUploadMapping() public method

Update upload mapping
public updateUploadMapping ( string $name, array $options = [] ) : array
$name string
$options array
return array

updateUploadPreset() public method

Update upload preset
public updateUploadPreset ( string $name, array $options = [] ) : array
$name string
$options array
return array

upload() public method

Upload image to cloud.
public upload ( mixed $source, string $publicId = null, array $uploadOptions = [], array $tags = [] ) : CloudinaryWrapper
$source mixed
$publicId string
$uploadOptions array
$tags array
return CloudinaryWrapper

uploadMapping() public method

Get upload mapping
public uploadMapping ( string $name, array $options = [] ) : array
$name string
$options array
return array

uploadMappings() public method

List Upload Mappings
public uploadMappings ( array $options = [] ) : array
$options array
return array

uploadPreset() public method

Get upload mapping
public uploadPreset ( string $name, array $options = [] ) : array
$name string
$options array
return array

uploadPresets() public method

List Upload Presets
public uploadPresets ( array $options = [] ) : array
$options array
return array

uploadVideo() public method

Upload video to cloud.
public uploadVideo ( mixed $source, string $publicId = null, array $uploadOptions = [], array $tags = [] ) : CloudinaryWrapper
$source mixed
$publicId string
$uploadOptions array
$tags array
return CloudinaryWrapper

usage() public method

Get usage details
public usage ( array $options = [] ) : array
$options array
return array

Property Details

$cloudinary protected property

Cloudinary lib.
protected Cloudinary $cloudinary
return Cloudinary

$config protected property

Repository config.
protected Repository,Illuminate\Config $config
return Illuminate\Config\Repository

$uploadedResult protected property

Uploaded result.
protected array $uploadedResult
return array

$uploader protected property

Cloudinary uploader.
protected Uploader,Cloudinary $uploader
return Cloudinary\Uploader