PHPackages                             tzk/taiga-php - 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. tzk/taiga-php

AbandonedArchivedLibrary[API Development](/categories/api)

tzk/taiga-php
=============

A PHP wrapper for the Taiga.io API

v2.1.0(7y ago)122.2k9[1 issues](https://github.com/TZK-/TaigaPHP/issues)1MITPHPPHP ~5.5|~7.0

Since Jul 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/TZK-/TaigaPHP)[ Packagist](https://packagist.org/packages/tzk/taiga-php)[ RSS](/packages/tzk-taiga-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (2)Versions (17)Used By (1)

TaigaPHP
========

[](#taigaphp)

[![Build Status](https://camo.githubusercontent.com/b784652d82140580425a060f40ab7926d66fbd3f4182c0b2cdfeb57399cc718b/68747470733a2f2f7472617669732d63692e6f72672f545a4b2d2f54616967615048502e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/TZK-/TaigaPHP) [![Latest Stable Version](https://camo.githubusercontent.com/17fc2178bf1e98bca3b019662415856ad99d5b396d4d3b12a6eed6014d80c880/68747470733a2f2f706f7365722e707567782e6f72672f747a6b2f74616967612d7068702f76657273696f6e)](https://packagist.org/packages/tzk/taiga-php) [![Total Downloads](https://camo.githubusercontent.com/9f576ae39da9cdb11fd4bc1aa00756ba9c509e6269cd829598fdc2c6a403f774/68747470733a2f2f706f7365722e707567782e6f72672f747a6b2f74616967612d7068702f646f776e6c6f616473)](https://packagist.org/packages/tzk/taiga-php) [![License](https://camo.githubusercontent.com/61e745936b5037c2623c0b201d98a21f91abc3f803a5a0632f0b8c8aff3538ad/68747470733a2f2f706f7365722e707567782e6f72672f747a6b2f74616967612d7068702f6c6963656e7365)](https://packagist.org/packages/tzk/taiga-php)

TaigaPHP is a PHP wrapper used to handle the Taiga.io API easily.

(If you want to use this library with Laravel 5.x, take a look at )

Installation (Composer)
=======================

[](#installation-composer)

TaigaPHP has been written and *tested* for PHP &gt;=5.5 and and earlier versions. The only constraint is to have the cURL extension enabled.

To install the library, just run the command below:

```
composer require tzk/taiga-php
```

Authentication
==============

[](#authentication)

To send HTTP request to the API, you'll need to generate an Auth token.

The wrapper has a function to help you and you can just do like the code below or see [https://taigaio.github.io/taiga-doc/dist/api.html#\_authentication](https://taigaio.github.io/taiga-doc/dist/api.html#_authentication):

```
// The API Url
$baseUrl = 'https://api.taiga.io/api/v1/';

// The credentials used for the authentification
$credentials = [
    'username' => 'USERNAME',
    'password' => 'PASSWORD',
    'type'    => 'normal'
];

echo generate_taiga_auth_token($baseUrl, $credentials);
```

Get Taiga instance
==================

[](#get-taiga-instance)

```
$request = TZK\Taiga\CurlRequest();

$headers = [
    'language' => 'fr',
    'x-disable-pagination' => true
];

$taiga = new TZK\Taiga\Taiga($request, $baseUrl, $auth_token, $headers);
```

Change configuration on the fly
===============================

[](#change-configuration-on-the-fly)

You can change the configuration through HTTP headers on the fly.

You just need to call magic method which has the same name as the header you wanna set prefixed by 'set'.

Some headers are composed by multiple words separated by dashed (Ex. Accept-Language).

To get it works, you should write the header name without dashes and in a camel-case format.

Example
-------

[](#example)

```
$taiga->setAcceptLanguage('fr')->setAuthorization('Bearer ' . $auth_token);
```

To ease changing auth token or language on the fly, you can use shortcuts specified in *src/config/header\_shortcuts.php*

```
// In header_shortcuts.php
return [
    'language' => [
        'header' => 'Accept-Language',
    ],
    'authToken' => [
        'header' => 'Authorization',
        'prefix' => 'Bearer ',
    ],
];

// Will produce the same as the previous example.
$taiga->setLanguage('fr')->setAuthToken($token);
```

Register a new service
======================

[](#register-a-new-service)

The wrapper is based on 'Services' which wrap the API calls.

```
