hyperized/hostfact
最新稳定版本:v4.0.0
Composer 安装命令:
composer require hyperized/hostfact
包简介
Hostfact 3.0 API Implementation for Laravel
关键字:
README 文档
README
Official documentation:
Installation
Install using composer:
composer require hyperized/hostfact
This package supports Package Auto-Discovery (Laravel 5.5+) so it doesn't require you to manually add the ServiceProvider and alias.
If you are using a lower version of Laravel or not using Auto-Discovery you can add the Hostfact Service Provider to
the config/app.php file
Hyperized\Hostfact\HostfactServiceProvider::class,
Register an alias for Hostfact, also in config/app.php:
'Hostfact' => Hyperized\Hostfact\HostfactServiceProvider::class,
Now publish the Hostfact package into your installation:
php artisan vendor:publish --provider="Hyperized\Hostfact\HostfactServiceProvider" --tag="config"
This should give you a message
like: Copied File [/vendor/hyperized/hostfact/config/Hostfact.php] To [/config/Hostfact.php]
It's possible to edit your configuration variables in the config/Hostfact.php file or you can use the HOSTFACT_URL
and HOSTFACT_KEY environment variables to store sensitive information in the .env file
// config/Hostfact.php 'api_v2_url' => env('HOSTFACT_URL', 'https://yoursite.tld/Pro/apiv2/api.php'), 'api_v2_key' => env('HOSTFACT_KEY', 'token'), 'api_v2_timeout' => env('HOSTFACT_TIMEOUT', 20), // .env/.env.example HOSTFACT_URL=https://yoursite.tld/Pro/apiv2/api.php HOSTFACT_KEY=token HOSTFACT_TIMEOUT=20
Functionality
When writing code for this Hostfact package, consider that this package has been written as a basic interface.
This package will do the following:
- Provide an easy way to communicate with Hostfact API controllers;
- Document the available API controller endpoints with methods;
- Transport layer (HTTP/HTTPS) error catching;
- Basic error parsing;
This package will not:
- Parameter / input validation;
- Output validation;
You will need to consult the Hostfact API documentation to understand the acceptable input and output for each of the API controllers.
Examples
Example code:
use \Hyperized\Hostfact\Api\Controllers\Product; $products = Product::new() ->list([ 'searchfor' => 'invoice' ]);
License
统计信息
- 总下载量: 6.8k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-09-10