PHP code example of plin-code / job-boards-bamboohr

1. Go to this page and download the library: Download plin-code/job-boards-bamboohr library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

plin-code / job-boards-bamboohr example snippets


use GuzzleHttp\Client;
use GuzzleHttp\Psr7\HttpFactory;
use PlinCode\JobBoards\Http\HttpClient;
use PlinCode\JobBoards\BambooHR\BambooHRClient;

$http = new HttpClient(new Client, new HttpFactory);

$client = new BambooHRClient($http);

$jobs = $client->fetchJobsForCompany('acme');       // list<JobPostingDTO>
$name = $client->validateSlug('acme');              // ?string, the slug itself
$about = $client->fetchCompanyDescription('acme');  // always null, see below

use PlinCode\JobBoards\BambooHR\BambooHRClient;

$client = app(BambooHRClient::class);

foreach ($client->fetchJobsForCompany('acme') as $job) {
    JobPosting::updateOrCreate(
        ['external_id' => $job->externalId],
        $job->toArray(),
    );
}

'base_url'         => env('JOB_BOARDS_BAMBOOHR_BASE_URL', BambooHRClient::API_BASE_URL),
'job_url_template' => env('JOB_BOARDS_BAMBOOHR_JOB_URL_TEMPLATE', BambooHRClient::JOB_URL_TEMPLATE),
'timeout'          => env('JOB_BOARDS_BAMBOOHR_TIMEOUT', 30),
'lookup_timeout'   => env('JOB_BOARDS_BAMBOOHR_LOOKUP_TIMEOUT', 15),
'headers'          => ['Accept' => 'application/json'],