PHPackages                             ixudra/toggl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ixudra/toggl

ActiveLibrary[API Development](/categories/api)

ixudra/toggl
============

Custom PHP library to connect with the Toggl API - developed by Ixudra

3.0.0(6mo ago)27115.5k↓10.3%18[1 issues](https://github.com/ixudra/toggl/issues)1MITPHPPHP ^7.1||^8.0

Since Mar 3Pushed 5mo ago5 watchersCompare

[ Source](https://github.com/ixudra/toggl)[ Packagist](https://packagist.org/packages/ixudra/toggl)[ Docs](https://ixudra.be)[ RSS](/packages/ixudra-toggl/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (24)Used By (1)

ixudra/toggl
============

[](#ixudratoggl)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d02cb6c93534d8e894b78e5d413894d90634a43bdaa05d1beaa80d0ae4f36093/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6978756472612f746f67676c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ixudra/toggl)![license](https://camo.githubusercontent.com/1f97237556e142c67d9320459ec94b3970b085aaf027c67605b0a138e20cb364/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6978756472612f746f67676c2e737667)[![Total Downloads](https://camo.githubusercontent.com/da968beff159f0655bc89ac8077947d43e5f367f84e686f00917d289a4af86dc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6978756472612f746f67676c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ixudra/toggl)

Custom PHP library to connect with the Toggl API - developed by [Ixudra](https://ixudra.be).

This 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.

Installation
------------

[](#installation)

Pull this package in through Composer.

```
    {
        'require': {
            'ixudra/toggl': '2.*'
        }
    }
```

> 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.

### Laravel Integration

[](#laravel-integration)

#### Laravel 5.5+

[](#laravel-55)

Automatic package discovery will take care of registering the service provider and facade.

#### Laravel &lt; 5.5

[](#laravel--55)

Add the service provider to your `config/app.php` file

```
    'providers'         => array(

        //...
        Ixudra\Toggl\TogglServiceProvider::class,

    ),
```

Add the facade to your `config/app.php` file:

```
    'aliases'           => array(

        //...
        'Toggl'         => Ixudra\Toggl\Facades\Toggl::class,

    ),
```

#### Configuration

[](#configuration)

Add workspace ID and your personal API token to your `.env` file:

```

TOGGL_WORKSPACE=123
TOGGL_TOKEN=your_toggl_api_token

```

Add the following lines of code to your `config/services.php` file:

```
    'toggl' => [
        'workspace'     => env('TOGGL_WORKSPACE'),
        'token'         => env('TOGGL_TOKEN'),
    ],
```

The 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:

```
    // Sets the workspace ID to a new value
    Toggl::setWorkspaceId( 456 );
    // Sets the API token to a new value
    Toggl::setApiToken( 'second_toggl_api_token' );

    $response = Toggl::createClient( array( 'name' => 'Test company' ) );
```

> 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.

### Lumen 5.\* integration

[](#lumen-5-integration)

In your `bootstrap/app.php`, make sure you've un-commented the following line (around line 26):

```
$app->withFacades();

```

Then, register your class alias:

```
class_alias('Ixudra\Toggl\Facades\Toggl', 'Toggl');

```

Finally, you have to register your ServiceProvider (around line 70-80):

```
/*
|--------------------------------------------------------------------------
| Register Service Providers
|--------------------------------------------------------------------------
|
| Here we will register all of the application's service providers which
| are used to bind services into the container. Service providers are
| totally optional, so you are not required to uncomment this line.
|
*/

// $app->register('App\Providers\AppServiceProvider');

// Package service providers
$app->register(Ixudra\Toggl\TogglServiceProvider::class);

```

### Integration without Laravel

[](#integration-without-laravel)

Create a new instance of the `TogglService` where you would like to use the package:

```
    $workspaceId = 123;
    $apiToken = 'your_toggl_api_token';
    $togglService = new \Ixudra\Toggl\TogglService( $workspaceId, $apiToken );
```

Usage
-----

[](#usage)

The package provides an easy interface for sending requests to the Toggl API. For the full information regarding the API, all available methods and all possible parameters, I would refer you to the official Toggl API documentation on [GitHub](https://github.com/toggl/toggl_api_docs). The package provides a (nearly) exact match of (almost) all the functions that are described in the API documentation. The exact function definitions can be found in the `src/Traits` directory.

For your convenience, the package will automatically add several required parameters, so you don't have to worry about doing so. These parameters include the workspace ID and the API token. These parameters should not be included in any of the requests. Additionally, the package also provides several utility methods for the

### Laravel usage

[](#laravel-usage)

```
    // Return an overview of what users in the workspace are doing and have been doing
    $response = Toggl::dashboard();

    // Create a client
    $response = Toggl::createClient( array( 'name' => 'Test company' ) );

    // Get a summary information of this month for all user
    $response = Toggl::summaryThisMonth();

    // Get a summary information of last month for one specific user
    $response = Toggl::summaryLastMonth( array( 'user_ids' => '123' ) );
```

### Non-laravel usage

[](#non-laravel-usage)

```
    $workspaceId = 123;
    $apiToken = 'your_toggl_api_token';
    $togglService = new \Ixudra\Toggl\TogglService( $workspaceId, $apiToken );

    // Return an overview of what users in the workspace are doing and have been doing
    $response = $togglService->dashboard();

    // Create a client
    $response = $togglService->createClient( array( 'name' => 'Test company' ) );

    // Get a summary information of this month for all user
    $response = $togglService->summaryThisMonth();

    // Get a summary information of last month for one specific user
    $response = $togglService->summaryLastMonth( array( 'user_ids' => '123' ) );
```

Planning
--------

[](#planning)

- Add missing API methods
- Improve usability of existing API methods
- Add additional convenience method
- Update and improve documentation
- Support for multiple workspaces

Support
-------

[](#support)

Help me further develop and maintain this package by supporting me via [Patreon](https://www.patreon.com/ixudra)!!

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

Contact
-------

[](#contact)

For 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.

For any other questions, feel free to use the credentials listed below:

Jan Oris (developer)

- Email:
- Telephone: +32 496 94 20 57

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance68

Regular maintenance activity

Popularity45

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 61.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~144 days

Recently: every ~131 days

Total

23

Last Release

196d ago

Major Versions

0.12.0 → 1.0.02021-03-16

1.2.0 → 2.0.02024-05-26

2.1.2 → 3.0.02025-11-03

PHP version history (2 changes)0.1PHP &gt;=5.6.0

3.0.0PHP ^7.1||^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c441bf73a59ca680bb804e22e746002a07d1a44542e8c417a45317bc79b224d8?d=identicon)[Elimentz](/maintainers/Elimentz)

---

Top Contributors

[![elimentz](https://avatars.githubusercontent.com/u/1410811?v=4)](https://github.com/elimentz "elimentz (54 commits)")[![jals-es](https://avatars.githubusercontent.com/u/31510870?v=4)](https://github.com/jals-es "jals-es (11 commits)")[![diegodurrod](https://avatars.githubusercontent.com/u/46654166?v=4)](https://github.com/diegodurrod "diegodurrod (7 commits)")[![LemmoTresto](https://avatars.githubusercontent.com/u/25307557?v=4)](https://github.com/LemmoTresto "LemmoTresto (3 commits)")[![recycledbeans](https://avatars.githubusercontent.com/u/13002230?v=4)](https://github.com/recycledbeans "recycledbeans (2 commits)")[![Ruitjes](https://avatars.githubusercontent.com/u/26769441?v=4)](https://github.com/Ruitjes "Ruitjes (2 commits)")[![chatelao](https://avatars.githubusercontent.com/u/2461532?v=4)](https://github.com/chatelao "chatelao (2 commits)")[![stborchert](https://avatars.githubusercontent.com/u/105101?v=4)](https://github.com/stborchert "stborchert (1 commits)")[![d2roth](https://avatars.githubusercontent.com/u/17486071?v=4)](https://github.com/d2roth "d2roth (1 commits)")[![danieljimeneznz](https://avatars.githubusercontent.com/u/13009825?v=4)](https://github.com/danieljimeneznz "danieljimeneznz (1 commits)")[![danielroe](https://avatars.githubusercontent.com/u/28706372?v=4)](https://github.com/danielroe "danielroe (1 commits)")[![jobyh](https://avatars.githubusercontent.com/u/779072?v=4)](https://github.com/jobyh "jobyh (1 commits)")[![lukassivak](https://avatars.githubusercontent.com/u/418938?v=4)](https://github.com/lukassivak "lukassivak (1 commits)")[![Mikel-IZT](https://avatars.githubusercontent.com/u/49583824?v=4)](https://github.com/Mikel-IZT "Mikel-IZT (1 commits)")

---

Tags

apiixudralaraveltogglapilaravelIxudratoggl

### Embed Badge

![Health badge](/badges/ixudra-toggl/health.svg)

```
[![Health](https://phpackages.com/badges/ixudra-toggl/health.svg)](https://phpackages.com/packages/ixudra-toggl)
```

###  Alternatives

[spatie/laravel-fractal

An easy to use Fractal integration for Laravel applications

1.9k15.1M99](/packages/spatie-laravel-fractal)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[specialtactics/l5-api

Dependencies for the Laravel API Boilerplate package

3672.8k2](/packages/specialtactics-l5-api)[bmatovu/laravel-mtn-momo

Laravel MTN MOMO integration.

14310.9k](/packages/bmatovu-laravel-mtn-momo)[ozankurt/google-analytics

Laravel Google Analytics

7616.7k](/packages/ozankurt-google-analytics)[grazulex/laravel-apiroute

Complete API versioning lifecycle management for Laravel

1036.0k](/packages/grazulex-laravel-apiroute)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
