grantholle/orangehrm-api

An api wrapper for OrangeHRM.

1.2.3 2022-09-07 06:18 UTC

This package is auto-updated.

Last update: 2024-12-07 11:32:49 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is a very light client for the OrangeHRM API. It does not support all the capabilities of the API currently and is a work in progress.

Installation

You can install the package via composer:

composer require grantholle/orangehrm-api

You can publish the config file with:

php artisan vendor:publish --provider="GrantHolle\OrangeHrm\OrangeHrmServiceProvider" --tag="orangehrm-config"

This is the contents of the published config file:

return [
    'base_url' => env('ORANGEHRM_BASE_URL'),
    'client_id' => env('ORANGEHRM_CLIENT_ID'),
    'client_secret' => env('ORANGEHRM_CLIENT_SECRET'),
];

You should add the ORANGEHRM_BASE_URL, ORANGEHRM_CLIENT_ID, and ORANGEHRM_CLIENT_SECRET keys to your .env file. You can learn about how to create the api credentials in the documentation.

Usage

There are a handful of methods implemented, including addEmployee, getEmployee, and updateEmployee.

use GrantHolle\OrangeHrm\OrangeHrmFacade;

$employees = OrangeHrmFacade::getEmployees();

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

License

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