upmind / provision-provider-hello-world
'Hello World' example of a Provision Category and Providers
Requires
- php: 7.4 - 8.3
- upmind/provision-provider-base: ^3.0 || ^4.0
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.0 || ^10.0 || ^11.0
This package is auto-updated.
Last update: 2024-12-15 18:31:30 UTC
README
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.