2017 © Pedro Peláez
 

library companies

image

honey-comb/companies

  • Tuesday, July 24, 2018
  • by jdmitrijev
  • Repository
  • 2 Watchers
  • 0 Stars
  • 181 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 8 % Grown

The README.md

HoneyComb companies package Build Status

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., (*1)

Requirement

  • php: ^7.1
  • laravel: ^5.6, (*2)

    Installation

Begin by installing this package through Composer., (*3)

    {
        "require": {
            "honey-comb/companies": "0.3.*"
        }
    }

or, (*4)

    composer require honey-comb/companies

Laravel integration

Firstly register the service provider and Facade by opening config/app.php, (*5)

HoneyComb\Companies\Providers\HCCompanyServiceProvider::class,

Usage

In the .env file please add these parameters:, (*6)

HC_COMPANY_REKVIZITAI_API_KEY=KEY
HC_COMPANY_REKVIZITAI_CLIENT_ID=ID

Through the help of HoneyComb\Companies\Services\HCCompanyService call findByCode('CODE') function, (*7)

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);
    }
}

The Versions