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";
}
PHP 8 is required.
You can install the package via composer:
composer require grafstorm/hitta_php_package
// 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);
Tests requiring proper API keys are skipped unless you provide them in your testing environment.
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.