PHP code example of steveworley / lagoon-php-sdk

1. Go to this page and download the library: Download steveworley/lagoon-php-sdk 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/ */

    

steveworley / lagoon-php-sdk example snippets


composer 
 php


use Lagoon\LagoonClient;

$client = new LagoonClient($endpoint, $token);
$customers = $client->customer()->all()->execute();
 php


use Lagoon\LagoonClient;

$client = new LagoonClient($endpoint, $token);
$customers = $client->project()->all()->fields(['name'])->execute();
 php


use Lagoon\LagoonClient;

$client = new LagoonClient($endpoint, $token);
$project = [
  'name' => 'my-proejct',
  'customer' => 1,
  'openshift' => 1,
  'gitUrl' => '[email protected]:test/test.git'
  'productEnvironment' => 'master',
  'branches' => 'master',
];
$customers = $client->project()->add($project)->execute();