{"id":13817126,"url":"https://github.com/ixudra/toggl","last_synced_at":"2025-04-30T22:32:02.424Z","repository":{"id":49159220,"uuid":"83850034","full_name":"ixudra/toggl","owner":"ixudra","description":"Custom PHP library to connect with the Toggl API - developed by Ixudra","archived":false,"fork":false,"pushed_at":"2023-12-02T21:07:06.000Z","size":47,"stargazers_count":24,"open_issues_count":1,"forks_count":15,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-14T09:49:02.247Z","etag":null,"topics":["api","ixudra","laravel","toggl"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ixudra.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-03-03T23:18:25.000Z","updated_at":"2023-11-27T22:00:42.000Z","dependencies_parsed_at":"2023-12-02T22:22:23.725Z","dependency_job_id":"e2b7914a-a7e3-43b4-b3b0-c7185ee86010","html_url":"https://github.com/ixudra/toggl","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixudra%2Ftoggl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixudra%2Ftoggl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixudra%2Ftoggl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixudra%2Ftoggl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ixudra","download_url":"https://codeload.github.com/ixudra/toggl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251791727,"owners_count":21644447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","ixudra","laravel","toggl"],"created_at":"2024-08-04T06:00:34.353Z","updated_at":"2025-04-30T22:32:02.117Z","avatar_url":"https://github.com/ixudra.png","language":"PHP","funding_links":["https://www.patreon.com/ixudra)!!"],"categories":["API wrapper"],"sub_categories":[],"readme":"ixudra/toggl\n================\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/ixudra/toggl.svg?style=flat-square)](https://packagist.org/packages/ixudra/toggl)\n[![license](https://img.shields.io/github/license/ixudra/toggl.svg)]()\n[![Total Downloads](https://img.shields.io/packagist/dt/ixudra/toggl.svg?style=flat-square)](https://packagist.org/packages/ixudra/toggl)\n\nCustom PHP library to connect with the Toggl API - developed by [Ixudra](https://ixudra.be).\n\nThis package can be used by anyone at any given time, but keep in mind that it is optimized for my personal custom workflow. It may not suit your project perfectly and modifications may be in order.\n\n\n\n## Installation\n\nPull this package in through Composer.\n\n```js\n\n    {\n        'require': {\n            'ixudra/toggl': '2.*'\n        }\n    }\n\n```\n\n\u003e Important: this package supports the latest version of the Toggle API (v9). If you want so use v8 of the API (soon to be deprecated), pull in version `1.2.0` instead.\n\n\n\n### Laravel Integration\n\n#### Laravel 5.5+\n\nAutomatic package discovery will take care of registering the\nservice provider and facade.\n\n#### Laravel \u003c 5.5\n\nAdd the service provider to your `config/app.php` file\n\n```php\n\n    'providers'         =\u003e array(\n\n        //...\n        Ixudra\\Toggl\\TogglServiceProvider::class,\n\n    ),\n\n```\n\nAdd the facade to your `config/app.php` file:\n\n```php\n\n    'aliases'           =\u003e array(\n\n        //...\n        'Toggl'         =\u003e Ixudra\\Toggl\\Facades\\Toggl::class,\n\n    ),\n\n```\n\n#### Configuration\n\nAdd workspace ID and your personal API token to your `.env` file:\n\n```\n\nTOGGL_WORKSPACE=123\nTOGGL_TOKEN=your_toggl_api_token\n\n```\n\nAdd the following lines of code to your `config/services.php` file:\n\n```php\n\n    'toggl' =\u003e [\n        'workspace'     =\u003e env('TOGGL_WORKSPACE'),\n        'token'         =\u003e env('TOGGL_TOKEN'),\n    ],\n\n```\n\nThe credentials in the configuration file will be used as the default for the package. If for whatever reason you would like to use a different workspace ID and/or API token, you can do so using two utility methods. You can use either one, none or both, depending on your personal needs:\n\n```php\n\n    // Sets the workspace ID to a new value\n    Toggl::setWorkspaceId( 456 );\n    // Sets the API token to a new value       \n    Toggl::setApiToken( 'second_toggl_api_token' );\n    \n    $response = Toggl::createClient( array( 'name' =\u003e 'Test company' ) );\n\n```\n\n \u003e Keep in mind that the workspace ID and API token are stored in the service configuration. This means that once one of these values is updated, it will not go back to the default once the next request is completed. It will keep the new value until it is reset to it's original value using the same utility methods.\n\n\n### Lumen 5.* integration\n\nIn your `bootstrap/app.php`, make sure you've un-commented the following line (around line 26):\n\n```\n$app-\u003ewithFacades();\n```\n\nThen, register your class alias:\n```\nclass_alias('Ixudra\\Toggl\\Facades\\Toggl', 'Toggl');\n```\n\nFinally, you have to register your ServiceProvider (around line 70-80):\n\n```\n/*\n|--------------------------------------------------------------------------\n| Register Service Providers\n|--------------------------------------------------------------------------\n|\n| Here we will register all of the application's service providers which\n| are used to bind services into the container. Service providers are\n| totally optional, so you are not required to uncomment this line.\n|\n*/\n\n// $app-\u003eregister('App\\Providers\\AppServiceProvider');\n\n// Package service providers\n$app-\u003eregister(Ixudra\\Toggl\\TogglServiceProvider::class);\n```\n\n\n### Integration without Laravel\n\nCreate a new instance of the `TogglService` where you would like to use the package:\n\n```php\n\n    $workspaceId = 123;\n    $apiToken = 'your_toggl_api_token';\n    $togglService = new \\Ixudra\\Toggl\\TogglService( $workspaceId, $apiToken );\n\n```\n\n\n\n## Usage\n\nThe package provides an easy interface for sending requests to the Toggl API. For the full information regarding the API,\nall available methods and all possible parameters, I would refer you to the official Toggl API documentation on \n[GitHub](https://github.com/toggl/toggl_api_docs). The package provides a (nearly) exact match of (almost) all the functions that are described\nin the API documentation. The exact function definitions can be found in the `src/Traits` directory.\n\nFor your convenience, the package will automatically add several required parameters, so you don't have to worry about \ndoing so. These parameters include the workspace ID and the API token. These parameters should not be included in any\nof the requests. Additionally, the package also provides several utility methods for the \n\n\n### Laravel usage\n\n```php\n\n    // Return an overview of what users in the workspace are doing and have been doing\n    $response = Toggl::dashboard();\n\n    // Create a client\n    $response = Toggl::createClient( array( 'name' =\u003e 'Test company' ) );\n\n    // Get a summary information of this month for all user \n    $response = Toggl::summaryThisMonth();\n\n    // Get a summary information of last month for one specific user \n    $response = Toggl::summaryLastMonth( array( 'user_ids' =\u003e '123' ) );\n\n```\n\n\n### Non-laravel usage\n\n```php\n\n    $workspaceId = 123;\n    $apiToken = 'your_toggl_api_token';\n    $togglService = new \\Ixudra\\Toggl\\TogglService( $workspaceId, $apiToken );\n\n    // Return an overview of what users in the workspace are doing and have been doing\n    $response = $togglService-\u003edashboard();\n\n    // Create a client\n    $response = $togglService-\u003ecreateClient( array( 'name' =\u003e 'Test company' ) );\n\n    // Get a summary information of this month for all user \n    $response = $togglService-\u003esummaryThisMonth();\n\n    // Get a summary information of last month for one specific user \n    $response = $togglService-\u003esummaryLastMonth( array( 'user_ids' =\u003e '123' ) );\n\n```\n\n\n\n\n## Planning\n\n- Add missing API methods\n- Improve usability of existing API methods\n- Add additional convenience method\n- Update and improve documentation\n- Support for multiple workspaces\n\n\n\n\n## Support\n\nHelp me further develop and maintain this package by supporting me via [Patreon](https://www.patreon.com/ixudra)!!\n\n\n\n\n## License\n\nThis package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)\n\n\n\n\n## Contact\n\nFor package questions, bug, suggestions and/or feature requests, please use the GitHub issue system and/or submit a pull request. When submitting an issue, always provide a detailed explanation of your problem, any response or feedback your get, log messages that might be relevant as well as a source code example that demonstrates the problem. If not, I will most likely not be able to help you with your problem. Please review the [contribution guidelines](https://github.com/ixudra/toggl/blob/master/CONTRIBUTING.md) before submitting your issue or pull request.\n\nFor any other questions, feel free to use the credentials listed below: \n\nJan Oris (developer)\n\n- Email: jan.oris@ixudra.be\n- Telephone: +32 496 94 20 57\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixudra%2Ftoggl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fixudra%2Ftoggl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixudra%2Ftoggl/lists"}