PHP code example of kallencode / laravel-wakatime

1. Go to this page and download the library: Download kallencode/laravel-wakatime library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kallencode / laravel-wakatime example snippets


// config/app.php
'providers' => [
    ...
    Kallencode\Wakatime\WakatimeServiceProvider::class,
    ...
];

// config/app.php
'aliases' => [
    ...
    'Wakatime' => Kallencode\Wakatime\WakatimeFacade::class,
    ...
];

php artisan vendor:publish --provider="Kallencode\Wakatime\WakatimeServiceProvider"

return [

    'apiKey' => env('WAKATIME_API_KEY'),

    'baseURl' => env('WAKATIME_BASE_URL','https://wakatime.com/api/v1/')

];

$result = Wakatime::performRequest("new/resource", [
        'date' => \Carbon\Carbon::now()->format('Y-m-d'),
        'project' => 'project'], []);
 php
$userDurations = Wakatime::fetchUserDuration(\Carbon\Carbon::now());