PHP code example of nomadicsoft / envoyer-php

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

    

nomadicsoft / envoyer-php example snippets


use Nomadicsoft\Envoyer\Envoyer;

$envoyer = Envoyer::make($apiToken);

// Projects
$envoyer->projects()->all();
$envoyer->projects()->find($projectId);

// Environment (.env in Envoyer — canonical source, not the server file)
$envoyer->environments()->on($projectId)->get($environmentKey);
$envoyer->environments()->on($projectId)->update($environmentKey, $contents, $serverIds);
$envoyer->environments()->on($projectId)->servers();

// Deployments
$envoyer->deployments()->on($projectId)->all();
$envoyer->deployments()->on($projectId)->deploy(['from' => 'branch', 'branch' => 'main']);

// Servers, hooks, heartbeats, collaborators, notifications, actions
$envoyer->servers()->on($projectId)->all();
$envoyer->hooks()->on($projectId)->all();
$envoyer->heartbeats()->on($projectId)->all();
$envoyer->actions()->all();
bash
composer