This package includes a simple-to-use client to communicate with the Pact API.
Note: This repository only contains the integration code of the Kadena PHP client for Laravel. If you want to use the Kadena PHP client in a framework-agnostic way, take a look at the kadena-php/client repository.
Via Composer
composer require kadena-php/laravel
You can configure the Kadena API base URL by configuring your env
:
KADENA_API_BASE_URL=http://localhost:8000
Optionally, you can also publish the config file:
php artisan vendor:publish --tag=kadena-config
For usage examples, see the kadena-php/client repository before starting to use the Laravel integration.
This package contains three convenience Facades. Their usage are largely similar to the classes documented in the client package:
Kadena\Laravel\Facades\Client
Usage
$response = Client::local($signedCommand);
Kadena\Laravel\Facades\Command
Usage
$command = Command::withExecutePayload($payload)
->withMetadata($metadata)
->make();
To see all options, see the Command Factory documentation in the client repository.
Kadena\Laravel\Facades\Metadata
Usage
$metadata = Metadata::make();
To see all options, see the Metadata Factory documentation in the client repository.
When not specifying any options like the example above, the options set in the kadena.php
config will be used.
An example of the default config:
return [
'api' => [
'base_url' => env('KADENA_API_BASE_URL', 'http://localhost:8888'),
],
'meta' => [
'ttl' => 7200,
'gasLimit' => 10000,
'chainId' => '0',
'gasPrice' => 1e-8,
'sender' => ''
],
];
Please see the changelog for more information on what has changed recently.
./vendor/bin/phpunit
Please see contributing.md for details and a todolist.
If you discover any security-related issues, please send an email instead of using the issue tracker.
MIT. Please see the license file for more information.