PHP code example of scalify / puppet-master-client-laravel
1. Go to this page and download the library: Download scalify/puppet-master-client-laravel 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/ */
scalify / puppet-master-client-laravel example snippets
namespace My\Laravel\Service;
use Scalify\PuppetMaster\Client\ClientInterface;
class Something
{
/**
* @var ClientInterface
*/
private $client;
public function __construct(ClientInterface $client)
{
$this->client = $client;
}
public function doSomething()
{
$job = $this->client->getJob("my-job-uuid-example");
echo(sprintf("Job has status %s", $job->getStatus()));
}
}
bash
php artisan vendor:publish --provider="Scalify\PuppetMaster\ServiceProvider"