honey-comb / companies
Honeycomb company package
Installs: 3 668
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^7.1
- honey-comb/core: 0.3.*
- laravel/framework: 5.6.*
Requires (Dev)
- codedungeon/phpunit-result-printer: ^0.14
- mockery/mockery: ^1.0
- orchestra/testbench-browser-kit: ^3.6
- phpunit/phpunit: ~7.0
README
Description
HoneyComb CMS Companies package, stores simple information about company. Currently contains integration with (rekvizitai.vz.lt) for automated company data retrieval for Lithuanian companies.
Requirement
- php:
^7.1
- laravel:
^5.6
Installation
Begin by installing this package through Composer.
{ "require": { "honey-comb/companies": "0.3.*" } }
or
composer require honey-comb/companies
Laravel integration
Firstly register the service provider and Facade by opening config/app.php
HoneyComb\Companies\Providers\HCCompanyServiceProvider::class,
Usage
In the .env
file please add these parameters:
HC_COMPANY_REKVIZITAI_API_KEY=KEY
HC_COMPANY_REKVIZITAI_CLIENT_ID=ID
Through the help of HoneyComb\Companies\Services\HCCompanyService
call findByCode('CODE')
function
EXAMPLE
<?php
namespace HoneyComb\Companies\Http\Controllers\Admin;
use HoneyComb\Companies\Services\HCCompanyService;
use HoneyComb\Core\Http\Controllers\HCBaseController;
class HCCompanyController extends HCBaseController
{
/**
* @var HCCompanyService
*/
private $service;
public function __construct(HCCompanyService $service)
{
$this->service = $service;
}
public function findByCode(string $code): ?HCCompany
{
return $this->service->findByCode($code);
}
public function findAllFromRekvizitai(string $title): array
{
return $this->service->searchByTitleFromRekvizitai($title);
}
}