PHP code example of rayful / hr-login-client

1. Go to this page and download the library: Download rayful/hr-login-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/ */

    

rayful / hr-login-client example snippets


$root = "https://hr.system/user_check";

$client = new \rayful\Tool\HR\LoginClient($root);
try{
    $user = $client->tryGetUser("username","password");
    $this->saveSession($user);
}catch (\rayful\Tool\HR\LoginException $exception){
    $this->displayError($exception->getMessage());
    $this->logErrorCode($exception->getCode());
}