upmind/provision-provider-hello-world

There is no license information available for the latest version (v1.1.0) of this package.

'Hello World' example of a Provision Category and Providers

v1.1.0 2024-02-15 11:01 UTC

This package is auto-updated.

Last update: 2024-12-15 18:31:30 UTC


README

Latest Version on Packagist

This package is a basic 'Hello World' example of a Provision Category and Providers.

Installation

composer require upmind/provision-provider-hello-world

Usage

This library makes use of upmind/provision-provider-base primitives which we suggest you familiarize yourself with by reading the usage section in the README.

Quick-start

See the below example to generat a greeting:

<?php

use Illuminate\Support\Facades\App;
use Upmind\ProvisionBase\ProviderFactory;

$configuration = [
    'api_key' => 'example',
    'api_secret' => 'shhh!',
];

$factory = App::make(ProviderFactory::class);
$provider = $factory->create('hello-world', 'hello-foo', $configuration);

$createParameters = [
    'name' => 'Harry',
];
$function = $provider->makeJob('greeting', $createParameters);

$greetingResult = $function->execute();

if ($greetingResult->isError()) {
    throw new RuntimeException($greetingResult->getMessage(), 0, $greetingResult->getException());
}

/** @var \Upmind\ProvisionProviders\HelloWorld\Data\Greeting */
$greeting = $greetingResult->getData();

// $greeting->sentence; // Hello Harry! From your friend, Foo.
// ...

Supported Providers

The following providers are currently implemented:

  • Hello Foo
  • Hello Bar

Functions

greeting()

Greet a person by name.

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Credits

License

GNU General Public License version 3 (GPLv3). Please see License File for more information.

Upmind

Sell, manage and support web hosting, domain names, ssl certificates, website builders and more with Upmind.com - the ultimate web hosting billing and management solution.