grantholle / orangehrm-api
An api wrapper for OrangeHRM.
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.3
- illuminate/contracts: ^8.0|^9.0
- illuminate/support: ^8.0|^9.0
- spatie/laravel-package-tools: ^1.4.3
Requires (Dev)
- brianium/paratest: ^6.2
- nunomaduro/collision: ^5.3
- orchestra/testbench: ^6.15
- phpunit/phpunit: ^9.3
- spatie/laravel-ray: ^1.23
- vimeo/psalm: ^4.8
README
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.