PHP code example of thomaswelton / laravel-rackspace-opencloud
1. Go to this page and download the library: Download thomaswelton/laravel-rackspace-opencloud 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/ */
thomaswelton / laravel-rackspace-opencloud example snippets
'providers' => array(
Thomaswelton\LaravelRackspaceOpencloud\LaravelRackspaceOpencloudServiceProvider
)
'aliases' => array(
'OpenCloud' => 'Thomaswelton\LaravelRackspaceOpencloud\Facades\OpenCloud'
)
OpenCloud::upload($container, $file, $name = null)
Route::post('/upload', function()
{
if(Input::hasFile('image')){
$file = OpenCloud::upload('my-container', Input::file('image'));
}
$cdnUrl = $file->PublicURL();
// Do something with $cdnUrl
return Redirect::to('/upload');
});
OpenCloud::delete($container, $file)
php artisan config:publish thomaswelton/laravel-rackspace-opencloud
php artisan cdn:sync public/assets
php artisan cdn:sync public/assets --trim=public