PHP code example of programic / laravel-hoorayhr

1. Go to this page and download the library: Download programic/laravel-hoorayhr 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/ */

    

programic / laravel-hoorayhr example snippets


return [
    'hooray' => [
           'username' => env('HOORAY_USERNAME', '')
           'password' => env('HOORAY_PASSWORD', '')
    ],
];

use Programic\Hooray\HoorayHR;

public function index(HoorayHR $hooray) {
    // Fetch users
    $hooray->getUsers();
    
    // Fetch & filter calendars
    $hooray->getCalenders(['year' => 2021, 'userId' => 1]);
}


use Programic\Hooray\HoorayHR;

$this->app->resolving(HoorayHR::class, function ($hooray) {
    $hooray->setCredentials('username', 'password');
});