PHP code example of maniaba / asset-connect
1. Go to this page and download the library: Download maniaba/asset-connect library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
maniaba / asset-connect example snippets
// Add an asset to a user
$asset = $user->addAsset('/path/to/file.jpg')
->withCustomProperties([
'title' => 'Profile Picture',
'description' => 'User profile picture'
])
->toAssetCollection();
// Get all assets for a user
$assets = $user->getAssets();
// Get the URL to an asset
$url = $user->getFirstAsset()->getUrl();
// Delete assets from a specific collection
$user->deleteAssets(ImagesCollection::class);