eeappdev / tidsbanken
HTTP Macro for Tidsbanken API
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.0.1
- illuminate/support: ^11.0
README
This Laravel plugin enables easy integration with the Tidsbanken API. Tidsbanken provides various functionalities related to employee time tracking and management. For detailed information on using the Tidsbanken API, refer to Tidsbanken Developer Documentation.
Installation
Install the plugin via Composer:
composer require eeappdev/tidsbanken
Configuration
Publish the configuration file to customize your Tidsbanken API settings:
php artisan vendor:publish --provider="Eeappdev\Tidsbanken\TidsbankenServiceProvider"
After publishing, you'll find the tidsbanken.php configuration file in your config directory. Update the following environment variables in your .env file with your Tidsbanken API credentials:
TIDSBANKEN_BASEURL= TIDSBANKEN_TB_KEY= TIDSBANKEN_SUBSCRIPTION_KEY= TIDSBANKEN_API_VERSION=
Usage
Use the Http::tidsbanken() macro to make requests to the Tidsbanken API:
use Illuminate\Support\Facades\Http; $response = Http::tidsbanken()->get('ansatt/ansatt?$select=Id,Fornavn&$top=2');
Replace the endpoint and request parameters according to your API needs. Consult the Tidsbanken API documentation for detailed information on available endpoints and request formats.