filippo-toso/alleantia-sdk
最新稳定版本:v1.0.6
Composer 安装命令:
composer require filippo-toso/alleantia-sdk
包简介
Alleantia IOT Server unofficial PHP SDK
README 文档
README
A simple SDK to access Alleantia IOT Server Rest APIs (version 2.3).
Requirements
- PHP 8.0+
Installing
Use Composer to install it:
composer require filippo-toso/alleantia-sdk
If you don't already have an implementation for psr/http-factory and psr/http-client, you should execute also:
composer require php-http/curl-client laminas/laminas-diactoros
Vanilla PHP usage
Create the SDK instance and call the various endpoints.
use FilippoToso\Alleantia\Alleantia; use FilippoToso\Alleantia\Options; require(__DIR__ . '/../vendor/autoload.php'); $options = new Options([ 'base_url' => 'http://192.168.1.123:8081', 'username' => 'admin', 'password' => 'secret', ]); $alleantia = new Alleantia($options); $response = $alleantia->system()->info(); print_r($response->body());
Laravel usage
In your config/services.php files add:
return [ // ... 'alleantia' => [ 'base_url' => env('ALLEANTIA_BASE_URL'), 'username' => env('ALLEANTIA_USERNAME'), 'password' => env('ALLEANTIA_PASSWORD'), ], ];
In your .env file, add the following variables:
ALLEANTIA_BASE_URL=http://192.168.1.123:8081
ALLEANTIA_USERNAME=admin
ALLEANTIA_PASSWORD=secret
In your Laravel code:
use FilippoToso\Alleantia\Laravel\Alleantia; $response = Alleantia::system()->info(); dump($response->body());
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-03-23