PHP code example of yurich84 / jobready-api

1. Go to this page and download the library: Download yurich84/jobready-api 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/ */

    

yurich84 / jobready-api example snippets



use Yurich84\JobReadyApi\Entities\Courses;
...
    $course_number = '99AUS999';
    $courses = (new Courses)->find($course_number);

use Yurich84\JobReadyApi\Entities\Events;
use Yurich84\JobReadyApi\JobReady;
use \Carbon\Carbon;
...
$events = (new Events)
    ->where(Events::PARAMETER_DATE_FROM, Carbon::now()->format(JobReady::DATE_FORMAT))
    ->where(Events::PARAMETER_DATE_TO, Carbon::now()->addWeek()->format(JobReady::DATE_FORMAT))
    ->get(20);

use Yurich84\JobReadyApi\Entities\Trainers;
...
$data = (new Trainers)->create([
    Trainers::FIELD_PARTY_ID => 'PAUS000000'
]);

use Yurich84\JobReadyApi\Entities\Trainers;
...
$payload = [
    Trainers::FIELD_ENABLED => true,
    Trainers::FIELD_EMPLOYMENT_BASIS => 'full-time',
    Trainers::FIELD_IND_ASSESSOR => true,
    Trainers::FIELD_IND_COORDINATOR => true,
    Trainers::FIELD_IND_TRAINER => true,
];
$data = (new Trainers)->update('9804', $payload);    

use Yurich84\JobReadyApi\Entities\Events;
use Yurich84\JobReadyApi\JobReady;
use \Carbon\Carbon;
...

$course_number = '99AUS999';

$date = Carbon::now()->addWeeks(2)->format(JobReady::DATE_FORMAT);

$payload = [
    'event' => [
        Events::FIELD_TITLE => 'Test Event',
        Events::FIELD_EVENT_DATE => $date,
        Events::FIELD_START_TIME => '09:00:00',
        Events::FIELD_END_TIME => '15:00:00',
        Events::FIELD_ALL_STAFF => true,
        Events::FIELD_ALL_STUDENTS => true,
    ]
];

$data = (new Events)->postResponse("courses/{$course_number}/events", $payload);