sdavis1902/lunanode-api-php

Php Wrapper for Lunanode Virtual Hosting Api

1.0.4 2017-08-25 19:08 UTC

This package is not auto-updated.

Last update: 2024-03-16 17:36:28 UTC


README

Latest Version on Packagist Software License Total Downloads

This is a simple wrapper for Lunanode Hostings api.

Install

Via Composer

$ composer require sdavis1902/lunanode-api-php

Usage

$api = new \sdavis1902\LunanodeApiPhp\Lunanode($api_id, $api_key);
$vms = $api->request('vm', 'list');

foreach( $vms as $vm ){
    $info = $api->request('vm', 'info', [
        'vm_id' => $vm->vm_id
    ]); 
}

Laravel 5

Add Service Provider and Alias ( not required for 5.5 )

'providers' => [
    ... 
    sdavis1902\LunanodeApiPhp\Laravel\LunanodeServiceProvider::class,
],
'aliases' => [
    ... 
    'Lunanode' => sdavis1902\LunanodeApiPhp\Laravel\Lunanode::class,
],

Add the following to your .env file

LND_API_ID=apiid
LND_API_KEY=apikey

Then call the same methods using the Facade

$vms = Lunanode::request('vm', 'list');

foreach( $vms as $vm ){
    $info = Lunanode::request('vm', 'info', [
        'vm_id' => $vm->vm_id
    ]);
}

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email s.davis1902@gmail.com instead of using the issue tracker.

Credits

License

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