PHP code example of iceithq / payroll-php-client

1. Go to this page and download the library: Download iceithq/payroll-php-client 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/ */

    

iceithq / payroll-php-client example snippets


composer 



_url = 'http://localhost:8003/api/v2';
$client = new Payroll\Client($base_url, true);
$r = $client->employee()->login('your_username', 'your_password');
$token = $r->token;
$client->token($token);
$r = $client->employee()->time_in();
$r = $client->employee()->time_out();
$r = $client->employee()->get_timesheets();

$r = $client->employee()->apply_for_leave([
    'start_date' => '2024-07-01',
    'end_date' => '2024-07-05',
    'reason' => 'Vacation',
]);
$r = $client->employee()->get_leaves();

print_r($r);