mybuilder / when-i-work-api
Library that support connections and retrieve data from WhenIWork.com API
Installs: 9 690
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 14
Forks: 1
Open Issues: 0
Requires
- php: >=7.4
- doctrine/collections: ^1.7
- guzzlehttp/guzzle: ^6.2||^7.0
- jms/serializer: ^3.0
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: ^9.0
README
This library support connection and retrieval of data from WhenIWork.com API. At least PHP 7.4 is required.
Docs: http://dev.wheniwork.com
require_once __DIR__ . '/vendor/autoload.php'; use MyBuilder\Library\WhenIWork\Repository\PayrollRepository; use MyBuilder\Library\WhenIWork\Repository\UserRepository; use MyBuilder\Library\WhenIWork\Service\WhenIWorkApi; $serializer = JMS\Serializer\SerializerBuilder::create()->build(); $client = new GuzzleHttp\Client(); $whenIWorkApi = new WhenIWorkApi($client, 'your-developer-key', 'user-email', 'user-password'); $userRepository = new UserRepository($whenIWorkApi, $serializer); $payrollRepository = new PayrollRepository($whenIWorkApi, $serializer);
List of all users:
$users = $userRepository->findAll();
List of all payroll periods:
$payrolls = $payrollRepository->findByPeriod();
Todos:
- Add more models that are supported via WhenIWork API
- Add more functions that are supported via WhenIWork API