programic/laravel-hoorayhr

Wrapper for the HoorayHR API

v1.0.0 2021-08-13 09:11 UTC

This package is auto-updated.

Last update: 2024-05-13 15:34:49 UTC


README

Latest Version on Packagist Total Downloads

This package is a wrapper for the HoorayHR API

Installation

This package requires PHP 7.2 and Laravel 5.8 or higher.

composer require programic/permissions

Setup

Add Hooray credentials to config/services.php

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

And update .env credentials.

Basic Usage

use Programic\Hooray\HoorayHR;

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

Extended Credentials

You can update the HoorayHR credentials per auth user. This is possible to add the following in a Service Provider:

use Programic\Hooray\HoorayHR;

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

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email info@programic.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.