2017 © Pedro Peláez
 

library laravesta

VestaCP API for Laravel.

image

woenel/laravesta

VestaCP API for Laravel.

  • Tuesday, July 31, 2018
  • by woenel
  • Repository
  • 2 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 100 % Grown

The README.md

Laravesta

VestaCP API for Laravel., (*1)

Packagist, (*2)

Installation

Install using Composer, (*3)

$ composer require woenel/laravesta "^0.3"

Publish the config file named laravesta.php so you can set the hostname, username, password and other configuration., (*4)

$ php artisan vendor:publish --provider="Woenel\Laravesta\LaravestaServiceProvider"

Usage

Create User Account

use Laravesta;

$res = Laravesta::execute('v-add-user', [
    'arg1' => 'user01',             // username
    'arg2' => 'p@ssw0rd',           // password
    'arg3' => 'user01@example.com', // email
    'arg4' => 'default',            // package
    'arg5' => 'Ronnel',             // first name
    'arg6' => 'Martinez'            // last name
]);

if($res->getCode() == 0) {
    return "User account has been successfuly created";
}

return "Query returned error code: " . $res->getCode();

getCode() returns code instead of data., (*5)

See https://vestacp.com/docs/api/#return_codes for returned code meaning., (*6)

List User Account

use Laravesta;

$res = Laravesta::execute('v-list-user', [
    'arg1' => 'user01', // username
    'arg2' => 'json'    // format
]);

return json_decode($res->getData(), true);

If the command (like v-list-user) is expected to return data aside from code, you can use getData() to get it., (*7)

For more commands (like v-add-user and v-list-user), visit VestaCP CLI Documentation at https://vestacp.com/docs/cli/., (*8)

The Versions

31/07 2018

dev-master

9999999-dev

VestaCP API for Laravel.

  Sources   Download

MIT

The Requires

 

31/07 2018

v0.3.0

0.3.0.0

VestaCP API for Laravel.

  Sources   Download

MIT

The Requires

 

18/05 2018

v0.2.1

0.2.1.0

VestaCP API for Laravel.

  Sources   Download

MIT

The Requires