PHPackages                             madeitbelgium/teamleader - 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. madeitbelgium/teamleader

ActiveLibrary[API Development](/categories/api)

madeitbelgium/teamleader
========================

Laravel TeamLeader SDK

1.14.1(1y ago)1413.4k↓14.6%15[1 issues](https://github.com/madeITBelgium/TeamLeader/issues)LGPL-3.0-or-laterPHPPHP &gt;=7.2CI failing

Since Jan 22Pushed 1y ago3 watchersCompare

[ Source](https://github.com/madeITBelgium/TeamLeader)[ Packagist](https://packagist.org/packages/madeitbelgium/teamleader)[ Docs](https://www.madeit.be)[ GitHub Sponsors](https://github.com/madeitbelgium)[ RSS](/packages/madeitbelgium-teamleader/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (8)Versions (18)Used By (0)

PHP TeamLeader API Laravel SDK
==============================

[](#php-teamleader-api-laravel-sdk)

[![Latest Stable Version](https://camo.githubusercontent.com/7f31103fea088cbcdc12d62f67cd84abafa186ae0e318f748098dcff9ee366b4/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f5465616d4c65616465722f762f737461626c652e737667)](https://packagist.org/packages/madeITBelgium/TeamLeader)[![Total Downloads](https://camo.githubusercontent.com/059919c49f319d463e7b3bb109ded366dc40ce40a0b6d7e5b8faae6b5e6669f9/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f5465616d4c65616465722f642f746f74616c2e737667)](https://packagist.org/packages/madeITBelgium/TeamLeader)[![License](https://camo.githubusercontent.com/f31e888777cf025d145b93aa86246132ad6047aff91360e5007f068c42cda269/68747470733a2f2f706f7365722e707567782e6f72672f6d616465495442656c6769756d2f5465616d4c65616465722f6c6963656e73652e737667)](https://packagist.org/packages/madeITBelgium/TeamLeader)

With this Laravel package you can create a TeamLeader integration.

Installation
============

[](#installation)

```
composer require madeitbelgium/teamleader

```

Or require this package in your `composer.json` and update composer.

```
"madeitbelgium/teamleader": "^1.8"
```

Publish config file
-------------------

[](#publish-config-file)

```
php artisan vendor:publish --provider="MadeITBelgium\TeamLeader\ServiceProvider\TeamLeader"
```

Laravel &lt;5.5
---------------

[](#laravel-55)

After updating composer, add the ServiceProvider to the providers array in `config/app.php`

```
MadeITBelgium\TeamLeader\ServiceProvider\TeamLeader::class,
```

You can use the facade for shorter code. Add this to your aliases:

```
'TeamLeader' => MadeITBelgium\TeamLeader\Facade\TeamLeader::class,
```

Documentation
=============

[](#documentation)

Usage
-----

[](#usage)

```
use MadeITBelgium\TeamLeader\TeamLeader;

$teamLeader = new TeamLeader($appUrl, $clientId, $clientSecret, $redirectUri, $client = null);
```

In laravel you can use the Facade

```
use MadeITBelgium\TeamLeader\Facade\TeamLeader;

$teamLeaderContact = TeamLeader::crm()->contact()->add([
    'first_name' => 'Tjebbe',
    'last_name' => 'Lievens',
    'emails' => [
        [
            'type' => 'primary',
            'email' => 'info@madeit.be',
        ]
    ],
    'telephones' => [
        ['type' => 'mobile', 'number' => '0000000000'],
    ],
    'addresses' => [
        [
            'type' => 'primary',
            'address' => [
                'line_1' => 'Adres 1',
                'postal_code' => '1234',
                'city' => 'Cityname',
                'country' => 'BE',
            ]
        ]
    ],
    'language' => "nl",
]);
$contactId = $teamLeaderContact->data->id;
```

Authentication
--------------

[](#authentication)

Create a redirect URL and redirect the user to the teamleader URL.

```
TeamLeader::setRedirectUrl($redirect_url);
$redirectTo = TeamLeader::getAuthorizationUrl();
```

When the user succesfully is authenticated. The user is redirect to the provided redirect URL. You can now request (and save) the access and refersh token.

```
$accessTokenResult = TeamLeader::requestAccessToken($request->get('code'));
$access_token = TeamLeader::getAccessToken();
$refresh_token = TeamLeader::getRefreshToken();
$expired_at = TeamLeader::getExpiresAt();
```

The access token has a short expire time. Before each reqeust check if the access token is still valid.

```
TeamLeader::setAccessToken($access_token);
TeamLeader::setRefreshToken($refresh_token);
TeamLeader::setExpiresAt($expired_at);
$refresh = TeamLeader::checkAndDoRefresh();
if (false !== $refresh) {
    $access_token = TeamLeader::getAccessToken();
    $refresh_token = TeamLeader::getRefreshToken();
    $expired_at = TeamLeader::getExpiresAt();
    //Save data to database
}
```

All available endpoints
-----------------------

[](#all-available-endpoints)

Need more endpoints? Create an issue or contact us.

```
TeamLeader::setRedirectUrl($redirect_url);
TeamLeader::getAuthorizationUrl();

TeamLeader::requestAccessToken($code);
TeamLeader::getAccessToken();
TeamLeader::getRefreshToken();
TeamLeader::getExpiresAt();

TeamLeader::setAccessToken($access_token);
TeamLeader::setRefreshToken($refresh_token);
TeamLeader::setExpiresAt($expired_at);
TeamLeader::checkAndDoRefresh();

TeamLeader::general()->department()->list()
TeamLeader::general()->department()->info($id)
TeamLeader::general()->user()->me()
TeamLeader::general()->user()->list()
TeamLeader::general()->user()->info($id)
TeamLeader::general()->team()->list()
TeamLeader::general()->customField()->list()
TeamLeader::general()->customField()->info($id)
TeamLeader::general()->workType()->list()

TeamLeader::crm()->contact()->list(['filter' => ..., 'page' => ..., 'sort' => ...]); //https://developer.focus.teamleader.eu/#/reference/crm/contacts/contacts.list
TeamLeader::crm()->contact()->info($id); //https://developer.focus.teamleader.eu/#/reference/crm/contacts/contacts.info
TeamLeader::crm()->contact()->add(['first_name' => ..., ...]); //https://developer.focus.teamleader.eu/#/reference/crm/contacts/contacts.add
TeamLeader::crm()->contact()->update($id, ['first_name' => ...]) //https://developer.focus.teamleader.eu/#/reference/crm/contacts/contacts.update
TeamLeader::crm()->contact()->delete($id); //https://developer.focus.teamleader.eu/#/reference/crm/contacts/contacts.delete
TeamLeader::crm()->contact()->tag($id, $tags); //https://developer.focus.teamleader.eu/#/reference/crm/contacts/contacts.tag
TeamLeader::crm()->contact()->untag($id, $tags); //https://developer.focus.teamleader.eu/#/reference/crm/contacts/contacts.untag
TeamLeader::crm()->contact()->linkToCompany($id, $companyId, $position, $decisionMaker) //https://developer.focus.teamleader.eu/#/reference/crm/contacts/contacts.linktocompany
TeamLeader::crm()->contact()->unlinkToCompany($id, $companyId); //https://developer.focus.teamleader.eu/#/reference/crm/contacts/contacts.unlinkfromcompany

TeamLeader::crm()->company()->list(['filter' => ..., 'page' => ..., 'sort' => ...]); //https://developer.focus.teamleader.eu/#/reference/crm/companies/companies.list
TeamLeader::crm()->company()->info($id); //https://developer.focus.teamleader.eu/#/reference/crm/companies/companies.info
TeamLeader::crm()->company()->add(['first_name' => ..., ...]); //https://developer.focus.teamleader.eu/#/reference/crm/companies/companies.add
TeamLeader::crm()->company()->update($id, ['first_name' => ...]) //https://developer.focus.teamleader.eu/#/reference/crm/companies/companies.update
TeamLeader::crm()->company()->delete($id); //https://developer.focus.teamleader.eu/#/reference/crm/companies/companies.delete
TeamLeader::crm()->company()->tag($id, $tags); //https://developer.focus.teamleader.eu/#/reference/crm/companies/companies.tag
TeamLeader::crm()->company()->untag($id, $tags); //https://developer.focus.teamleader.eu/#/reference/crm/companies/companies.untag

TeamLeader::deals()->list($data = []); //https://developer.focus.teamleader.eu/#/reference/deals/deals/deals.list
TeamLeader::deals()->info($id); //https://developer.focus.teamleader.eu/#/reference/deals/deals/deals.info
TeamLeader::deals()->create($data); //https://developer.focus.teamleader.eu/#/reference/deals/deals/deals.create
TeamLeader::deals()->update($id, $data); //https://developer.focus.teamleader.eu/#/reference/deals/deals/deals.update
TeamLeader::deals()->move($id, $phaseId); //https://developer.focus.teamleader.eu/#/reference/deals/deals/deals.move
TeamLeader::deals()->win($id); //https://developer.focus.teamleader.eu/#/reference/deals/deals/deals.win
TeamLeader::deals()->lose($id, $reason_id = null, $extra_info = null); //https://developer.focus.teamleader.eu/#/reference/deals/deals/deals.lose
TeamLeader::deals()->delete($id); //https://developer.focus.teamleader.eu/#/reference/deals/deals/deals.delete
TeamLeader::deals()->lostReasons($data = []); //https://developer.focus.teamleader.eu/#/reference/deals/deals/lostreasons.list

TeamLeader::files()->list($data = [])
TeamLeader::files()->info($id)
TeamLeader::files()->download($id)
TeamLeader::files()->upload($name, $subject = [], $folder = 'General')
TeamLeader::files()->delete($id)

TeamLeader::invoicing()->invoices()->list($data = [])
TeamLeader::invoicing()->invoices()->info($id)
TeamLeader::invoicing()->invoices()->draft($data)
TeamLeader::invoicing()->invoices()->update($id, $data)
TeamLeader::invoicing()->invoices()->delete($id)
TeamLeader::invoicing()->invoices()->download($id, $format = 'pdf')
TeamLeader::invoicing()->invoices()->copy($id)
TeamLeader::invoicing()->invoices()->book($id, $on)
TeamLeader::invoicing()->invoices()->registerPayment($id, $paid_at, $amount, $currency = 'EUR')
TeamLeader::invoicing()->invoices()->credit($id, $creditNoteDate)
TeamLeader::invoicing()->invoices()->creditPartially($id, $creditNoteDate, $groupedLines, $discount = [])

TeamLeader::invoicing()->creditNotes()->list($data = [])
TeamLeader::invoicing()->creditNotes()->info($id)
TeamLeader::invoicing()->creditNotes()->download($id, $format = 'pdf')

TeamLeader::invoicing()->taxRates()->list()

TeamLeader::invoicing()->subscriptions()->list($data = [])
TeamLeader::invoicing()->subscriptions()->info($id)
TeamLeader::invoicing()->subscriptions()->create($data)
TeamLeader::invoicing()->subscriptions()->update($id, $data)
TeamLeader::invoicing()->subscriptions()->deactivate($id)

TeamLeader::products()->product()->categoriesList($data = [])
TeamLeader::products()->product()->list($data = [])
TeamLeader::products()->product()->info($id)
TeamLeader::products()->product()->add($data)

TeamLeader::mailTemplates()->list($data = [])

TeamLeader::timeTracking()->list($data = [])
TeamLeader::timeTracking()->info($id)
TeamLeader::timeTracking()->add($data)
TeamLeader::timeTracking()->update($id, $data)
TeamLeader::timeTracking()->resume($id, $data)
TeamLeader::timeTracking()->delete($id)

TeamLeader::milestones()->list($data = [])
TeamLeader::milestones()->info($id)
TeamLeader::milestones()->add($data)
TeamLeader::milestones()->update($id, $data)
TeamLeader::milestones()->delete($id)
TeamLeader::milestones()->close($id)
TeamLeader::milestones()->open($id)

TeamLeader::tasks()->list($data = [])
TeamLeader::tasks()->info($id)
TeamLeader::tasks()->add($data)
TeamLeader::tasks()->update($id, $data)
TeamLeader::tasks()->delete($id)
TeamLeader::tasks()->complete($id)
TeamLeader::tasks()->reopen($id)
TeamLeader::tasks()->schedule($id)

TeamLeader::webhooks()->list(); //https://developer.focus.teamleader.eu/#/reference/other/webhooks/webhooks.list
TeamLeader::webhooks()->register($data); //https://developer.focus.teamleader.eu/#/reference/other/webhooks/webhooks.register
TeamLeader::webhooks()->unregister($url, $types); //https://developer.focus.teamleader.eu/#/reference/other/webhooks/webhooks.unregister
```

The complete documentation can be found at:

Support
=======

[](#support)

Support github or mail:

Contributing
============

[](#contributing)

Please try to follow the psr-2 coding style guide.

License
=======

[](#license)

This package is licensed under LGPL. You are free to use it in personal and commercial projects. The code can be forked and modified, but the original copyright author should always be included!

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance44

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 78.5% 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 ~121 days

Recently: every ~161 days

Total

17

Last Release

414d ago

### Community

Maintainers

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

---

Top Contributors

[![madeITBelgium](https://avatars.githubusercontent.com/u/20304892?v=4)](https://github.com/madeITBelgium "madeITBelgium (113 commits)")[![sofian-io](https://avatars.githubusercontent.com/u/11960001?v=4)](https://github.com/sofian-io "sofian-io (14 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (5 commits)")[![mrk-j](https://avatars.githubusercontent.com/u/1250622?v=4)](https://github.com/mrk-j "mrk-j (5 commits)")[![m-bosch](https://avatars.githubusercontent.com/u/16580113?v=4)](https://github.com/m-bosch "m-bosch (2 commits)")[![indykoning](https://avatars.githubusercontent.com/u/15870933?v=4)](https://github.com/indykoning "indykoning (2 commits)")[![crashgh](https://avatars.githubusercontent.com/u/24417049?v=4)](https://github.com/crashgh "crashgh (2 commits)")[![gldrenthe89](https://avatars.githubusercontent.com/u/56250338?v=4)](https://github.com/gldrenthe89 "gldrenthe89 (1 commits)")

---

Tags

hacktoberfestlaravelphpteamleaderteamleader-crmlaravelTeamleader

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/madeitbelgium-teamleader/health.svg)

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

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M987](/packages/statamic-cms)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k9.0M69](/packages/spatie-laravel-responsecache)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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