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

1. Go to this page and download the library: Download plin-code/job-boards-workable 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-workable example snippets


use GuzzleHttp\Client;
use GuzzleHttp\Psr7\HttpFactory;
use PlinCode\JobBoards\Http\HttpClient;
use PlinCode\JobBoards\Workable\WorkableClient;

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

$client = new WorkableClient($http);

$jobs = $client->fetchJobsForCompany('acme');       // list<JobPostingDTO>
$name = $client->validateSlug('acme');              // ?string, the account name
$about = $client->fetchCompanyDescription('acme');  // ?string

use PlinCode\JobBoards\Workable\WorkableClient;

$client = app(WorkableClient::class);

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

'base_url'       => env('JOB_BOARDS_WORKABLE_BASE_URL', WorkableClient::API_BASE_URL),
'timeout'        => env('JOB_BOARDS_WORKABLE_TIMEOUT', 30),
'lookup_timeout' => env('JOB_BOARDS_WORKABLE_LOOKUP_TIMEOUT', 15),
'headers'        => ['Accept' => 'application/json'],