grafstorm/hitta_php_package
最新稳定版本:0.1.0
Composer 安装命令:
composer require grafstorm/hitta_php_package
包简介
Hitta.se PHP package
README 文档
README
Package under development
Fluent Wrapper around the API Hitta.se provides.
Example of usage:
$hitta = new Hitta('::api-user::', '::api-key::'); $result = $hitta->companies() ->what('Empire') ->where('Deathstar') ->find(); foreach($result->companies as $company) { echo $company->displayName . "\n"; }
Requirements
PHP 8 is required.
Installation
You can install the package via composer:
composer require grafstorm/hitta_php_package
Usage
// Hitta.se API Wrapper as a Laravel Package // Search for Swedish companies and people // Create a new instance of the API wrapper. $hitta = new Hitta('::api-user::', '::api-key::'); // Combined search. You can also explicitly call Hitta::combined() $hitta->what('Luke Skywalker') ->where('Kiruna') ->find(); $result = $hitta->combined() ->what('Empire') ->where('Deathstar') ->find(); foreach($result->companies as $company) { echo $company->displayName . "\n"; } foreach($result->people as $person) { echo $person->displayName . "\n"; } // Only Search for people $hitta->people() ->what('Luke Skywalker') ->find(); // Only Search for companies $hitta->companies() ->what('Empire') ->find(); // Optional search parameters $hitta->companies() ->what('Luke Skywalker') ->where('Kiruna') ->pageNumber(1) ->pageSize(10) ->rangeFrom(100) ->rangeTo(150) ->find(); // Example of Fetching details of a company or person with findPerson and findCompany. $result = $hitta->combined() ->what('Skywalker') ->find(); $personId = collect($result->people)->first()->id; $companyId = collect($result->companies)->first()->id; $hitta->findPerson($personId); $hitta->findCompany($companyId);
Testing
Tests requiring proper API keys are skipped unless you provide them in your testing environment.
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 1.03k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-05-25