定制 kadena-php/laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kadena-php/laravel

最新稳定版本:v0.1.0

Composer 安装命令:

composer require kadena-php/laravel

包简介

Laravel Client for use with the Kadena Pact API

README 文档

README

Latest Version on Packagist Total Downloads

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.

Installation

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

Usage

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:

Client Facade

Kadena\Laravel\Facades\Client

Usage

$response = Client::local($signedCommand);

Command Facade

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.

Metadata Facade

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.

Config

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' => ''
    ],
];

Change log

Please see the changelog for more information on what has changed recently.

Testing

./vendor/bin/phpunit

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security-related issues, please send an email instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.

统计信息

  • 总下载量: 23
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-05