artarts36 / head-hunter-api
HeadHunter API Client
0.3.7
2020-09-09 11:05 UTC
Requires
- php: >7.1
- ext-curl: *
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ^8.0
- squizlabs/php_codesniffer: 3.*
README
Description:
Client for work with API https://hh.ru
HeadHunter API Documentation: https://github.com/hhru/api
Installation:
composer require artarts36/head-hunter-api
Examples:
Simple:
use ArtARTs36\HeadHunterApi\Client; use ArtARTs36\HeadHunterApi\Features\Vacancy\Vacancy; $client = new Client('https://api.hh.ru', 'MyApp/my@mail.ru'); $feature = new Vacancy($client); $vacancy = $feature->find(123456789); var_dump($vacancy->getSpecializations());
Connect in Laravel:
1*. Set variables in .env:
HEADHUNTER_API_BASE_URL='https://api.hh.ru' HEADHUNTER_API_USER_AGENT='MyApp/my@mail.ru'
2*. Binding in bootstrap/app.php:
$app->singleton( \ArtARTs36\HeadHunterApi\Contracts\Client::class, function () { return new \ArtARTs36\HeadHunterApi\Client( env('HEADHUNTER_API_BASE_URL'), env('HEADHUNTER_API_USER_AGENT') ); } );