PHP code example of mohammadv184 / arvancloud-laravel

1. Go to this page and download the library: Download mohammadv184/arvancloud-laravel 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/ */

    

mohammadv184 / arvancloud-laravel example snippets


// In your providers array.
'providers' => [
    ...
    Mohammadv184\ArvanCloud\Laravel\ArvanCloudServiceProvider::class,
],

// In your aliases array.
'aliases' => [
    ...
    'CDN' => Mohammadv184\ArvanCloud\Laravel\ArvanCloudServiceProvider::class,
],

    'auth'=> [
        'default'  => 'ApiKey', //Set default Auth Type
        'UserToken'=> '',
        'ApiKey'   => '',//User API Key available in arvancloud panel
    ],
    ...

'services' => [
    'cdn' => [
        'baseUrl'  => 'https://napi.arvancloud.com/cdn/4.0/',
        'domain'   => 'your_domain.com',// Fill in the credentials here.
        'endpoints'=> [...],
    ],
    ...
]
    ...   

...
// Using Cdn Service
CDN::domain('your_domain.com')->get();

// more Example
// 1
CDN::domain()->get('your_domain.com');
// 2 
CDN::domain()->all();
// 3
CDN::cache('your_domain.com')->purge();
// 4
CDN::dns()->delete('Dns_id','your_domain.com')
              ->getMessage();