Giter Club home page Giter Club logo

arvancloud-laravel's Introduction

ArvanCloud

Laravel ArvanCloud API

Latest Stable Version Total Downloads Latest Unstable Version Build Status License

Laravel Package for the ArvanCloud API. This package supports PHP 7.3+.

For PHP integration you can use mohammadv184/arvancloud package.

List of contents

List of services

Install

Via Composer

composer require mohammadv184/arvancloud-laravel

Configure

If you are using Laravel 5.5 or higher then you don't need to add the provider and alias. (Skip to b)

a. In your config/app.php file add these two lines.

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

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

b. then run php artisan vendor:publish to publish config/arvancloud.php file in your config directory.

In the config file you can set the Config to be used for all your Service and you can also change the Config at runtime.

Choose what Authentication type you would like to use in your application.

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

Then fill the credentials for that Service in the services array.

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

How to use service

How to use ArvanCloud Services.

CDN

before doing any thing you need a domain in ArvanCloud CDN

In your code, use it like the below:

...
// 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();

Available methods:

  • domain :
    • all() : get all domains
    • create(string $domain) : Create New Domain.
    • get(string $domain = null) : Get Domain Settings
    • delete(string $domain = null) : Delete Domain.
  • cache :
    • get(string $domain = null) : Get Domain Cache settings.
    • update(array $data, string $domain = null) : Update Domain Cache settings.
    • purge(array $urls = null, string $domain = null) : Purge Domain Cache.
  • dns :
    • all() : Get All Domain Dns.
    • create(string $domain) : Create new Domain Dns.
    • get(string $domain = null) : Get Domain Dns Settings.
    • update(string $id, array $data, string $domain = null) : Update Domain Dns Settings.
    • delete(string $domain = null) : Delete Domain Dns.
    • cloud(string $id, bool $status = true, string $domain = null) : Update Domain Dns Cloud Status.
    • import($zoneFile, string $domain = null) : Import DNS records using BIND file
  • ssl :
    • get(string $domain = null) : Get Domain Ssl Settings.
    • update(string $sslType, string $domain = null) : Update Domain Ssl Settings.

Credits

License

The MIT License (MIT). Please see License File for more information.

arvancloud-laravel's People

Contributors

mohammadv184 avatar stylecibot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.