Download the PHP package mabasic/wakatime-php-api without Composer
On this page you can find all versions of the php package mabasic/wakatime-php-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mabasic/wakatime-php-api
More information about mabasic/wakatime-php-api
Files in mabasic/wakatime-php-api
Informations about the package wakatime-php-api
WakaTime PHP API
WakaTime API for PHP
Overview
This is a PHP package for WakaTime API. It supports resource endpoints from WakaTime API with additional helper methods for hours logged.
If you are using Laravel check out WakaTime Reports and Laravel.
If you find that some resource endpoints are missing feel free to send me a PR. (Be sure to include tests for your code)
Installation
Type this from command line:
Usage
You can get your Api Key from your settings page.
Resource Endpoints
Users
See: https://wakatime.com/developers/#users for details.
Summaries
See: https://wakatime.com/developers/#summaries for details.
Stats
See: https://wakatime.com/developers/#stats for details.
Heartbeats
See: https://wakatime.com/developers#heartbeats for details.
Helper methods aka Reports aka Shortcuts
getHoursLoggedFor
Calculates hours logged for a specific period. You can optionally specify a project.
$startDate
must be lower than$endDate
Example:
getHoursLoggedForLast
Calculates hours logged in last xy days, months. You can optionally specify a project.
Example:
getHoursLoggedForToday
Returns hours logged today. You can optionally specify a project.
getHoursLoggedForYesterday
Returns hours logged yesterday. You can optionally specify a project.
getHoursLoggedForLast7Days
Basic users can only see data for maximum 7 days. Become a Premium user to preserve all data history. You can still use any method as long as it is under 7 days.
getHoursLoggedForLast30Days
Calculates hours logged for last 30 days in history. You can optionally specify a project.
getHoursLoggedForThisMonth
Calculates hours logged for this month. You can optionally specify a project.
getHoursLoggedForLastMonth
Calculates hours logged for last month. You can optionally specify a project.
For developers only
Copy .env.example
file to .env
and set your api key and project name before running tests with:
Laravelista Sponsors & Backers
I would like to extend my thanks to the following sponsors & backers for funding my open-source journey. If you are interested in becoming a sponsor or backer, please visit the Laravelista Backers page.
Contributing
Thank you for considering contributing to WakaTime PHP API! The contribution guide can be found on the Laravelista website.
Code of Conduct
In order to ensure that the Laravelista community is welcoming to all, please review and abide by the Code of Conduct.
License
WakaTime PHP API is open-source software licensed under the MIT license.