Wakatime API for laravel
, (*1)
Simple package for interacting the the Wakatime API, (*2)
Installation
You can install the package via composer:, (*3)
``` bash
composer require kallencode/laravel-wakatime, (*4)
Install the ServiceProvider.
```php
// config/app.php
'providers' => [
...
Kallencode\Wakatime\WakatimeServiceProvider::class,
...
];
This package also comes with a facade:, (*5)
// config/app.php
'aliases' => [
...
'Wakatime' => Kallencode\Wakatime\WakatimeFacade::class,
...
];
You can publish the config file of this package with this command:, (*6)
php artisan vendor:publish --provider="Kallencode\Wakatime\WakatimeServiceProvider"
The following config file will be published in config/laravel-wakatime.php, (*7)
return [
'apiKey' => env('WAKATIME_API_KEY'),
'baseURl' => env('WAKATIME_BASE_URL','https://wakatime.com/api/v1/')
];
Usage
``` php
$userDurations = Wakatime::fetchUserDuration(\Carbon\Carbon::now());, (*8)
or use any not-yet-implemented wakatime API resource:
```php
$result = Wakatime::performRequest("new/resource", [
'date' => \Carbon\Carbon::now()->format('Y-m-d'),
'project' => 'project'], []);
Finding your API key
Go to https://wakatime.com/account/settings, (*9)
Changelog
Please see CHANGELOG for more information what has changed recently., (*10)
Testing
bash
$ composer test, (*11)
Contributing
Please see CONTRIBUTING for details., (*12)
Security
If you discover any security related issues, please email info@kallencode.nl instead of using the issue tracker., (*13)
Credits
About Kallencode
Kallencode, (*14)
License
The MIT License (MIT). Please see License File for more information., (*15)