PHPackages                             caherrera/php-gitlab-api - 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. caherrera/php-gitlab-api

ActiveLibrary[API Development](/categories/api)

caherrera/php-gitlab-api
========================

GitLab API v4 client for PHP

11.4.0(5y ago)018MITPHPPHP ^7.2.5 || ^8.0

Since Jun 18Pushed 4y agoCompare

[ Source](https://github.com/caherrera/php-gitlab-api)[ Packagist](https://packagist.org/packages/caherrera/php-gitlab-api)[ GitHub Sponsors](https://github.com/GrahamCampbell)[ RSS](/packages/caherrera-php-gitlab-api/feed)WikiDiscussions 11.4 Synced 1w ago

READMEChangelogDependencies (14)Versions (88)Used By (0)

GitLab PHP API Client
=====================

[](#gitlab-php-api-client)

We present a modern [GitLab API v4](https://docs.gitlab.com/ce/api/) client for PHP.

[![Banner](https://user-images.githubusercontent.com/2829600/86969006-fc2e3b00-c164-11ea-80b7-8750160a65c4.png)](https://user-images.githubusercontent.com/2829600/86969006-fc2e3b00-c164-11ea-80b7-8750160a65c4.png)

[![Build Status](https://camo.githubusercontent.com/5e461142dc9a27fb7d8dcc680d04a3be4eaf4c802fca555ce5e571a171032424/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f4769744c61625048502f436c69656e742f54657374733f6c6162656c3d5465737473267374796c653d666c61742d737175617265)](https://github.com/GitLabPHP/Client/actions?query=workflow%3ATests)[![StyleCI Status](https://camo.githubusercontent.com/8229025e244eda76dbf403b9dd7347673f5eaf539af3041ee1b46ec19f4014d6/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f363831363333352f736869656c64)](https://github.styleci.io/repos/6816335)[![Software License](https://camo.githubusercontent.com/c090e080484e2a2bc766446291d04437db823929042bf614b26a1643660ddf6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e3f7374796c653d666c61742d737175617265)](LICENSE)[![Packagist Downloads](https://camo.githubusercontent.com/3c65034dd7041eaa7d61076eef17ffb6dd4aac81acf89f3c1646b164f8211e9e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d34747468756d70687265792f7068702d6769746c61622d6170693f7374796c653d666c61742d737175617265)](https://packagist.org/packages/m4tthumphrey/php-gitlab-api)[![Latest Version](https://camo.githubusercontent.com/78be96c2de51c6c8b65ad501dc2517db9c1dd1016579e2989936085911378b6f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f4769744c61625048502f436c69656e743f7374796c653d666c61742d737175617265)](https://github.com/GitLabPHP/Client/releases)

This is strongly based on [php-github-api](https://github.com/KnpLabs/php-github-api) by [KnpLabs](https://github.com/KnpLabs). With this in mind, we now have **very similar** clients for:

- [Bitbucket](https://bitbucket.org/) - [bitbucket/client](https://packagist.org/packages/bitbucket/client) by [Graham Campbell](https://github.com/GrahamCampbell).
- [GitHub](https://github.com/) - [knplabs/github-api](https://packagist.org/packages/knplabs/github-api) by [KnpLabs](https://github.com/KnpLabs/php-github-api).
- [GitLab](https://gitlab.com/) - [m4tthumphrey/php-gitlab-api](https://packagist.org/packages/m4tthumphrey/php-gitlab-api) which is this package!

Check out the [change log](CHANGELOG.md), [releases](https://github.com/GitLabPHP/Client/releases), [security policy](https://github.com/GitLabPHP/Client/security/policy), [license](LICENSE), [code of conduct](.github/CODE_OF_CONDUCT.md), and [contribution guidelines](.github/CONTRIBUTING.md).

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

[](#installation)

This version supports [PHP](https://php.net) 7.2-8.0. To get started, simply require the project using [Composer](https://getcomposer.org). You will also need to install packages that "provide" [`psr/http-client-implementation`](https://packagist.org/providers/psr/http-client-implementation) and [`psr/http-factory-implementation`](https://packagist.org/providers/psr/http-factory-implementation).

### Standard Installation

[](#standard-installation)

```
$ composer require "m4tthumphrey/php-gitlab-api:^11.4" "guzzlehttp/guzzle:^7.2" "http-interop/http-factory-guzzle:^1.0"
```

### Framework Integration

[](#framework-integration)

#### Laravel:

[](#laravel)

```
$ composer require "graham-campbell/gitlab:^5.2" "guzzlehttp/guzzle:^7.2" "http-interop/http-factory-guzzle:^1.0"
```

#### Symfony:

[](#symfony)

```
$ composer require "zeichen32/gitlabapibundle:^6.0" "symfony/http-client:^5.2" "nyholm/psr7:^1.3"
```

We are decoupled from any HTTP messaging client by using [PSR-7](https://www.php-fig.org/psr/psr-7/), [PSR-17](https://www.php-fig.org/psr/psr-17/), [PSR-18](https://www.php-fig.org/psr/psr-18/), and [HTTPlug](https://httplug.io/). You can visit [HTTPlug for library users](https://docs.php-http.org/en/latest/httplug/users.html) to get more information about installing HTTPlug related packages. The framework integration [graham-campbell/gitlab](https://github.com/GrahamCampbell/Laravel-GitLab) is by [Graham Campbell](https://github.com/GrahamCampbell) and [zeichen32/gitlabapibundle](https://github.com/Zeichen32/GitLabApiBundle) is by [Jens Averkamp](https://github.com/Zeichen32).

General API Usage
-----------------

[](#general-api-usage)

```
// Token authentication
$client = new Gitlab\Client();
$client->authenticate('your_http_token', Gitlab\Client::AUTH_HTTP_TOKEN);

// OAuth2 authentication
$client = new Gitlab\Client();
$client->authenticate('your_oauth_token', Gitlab\Client::AUTH_OAUTH_TOKEN);

// An example API call
$project = $client->projects()->create('My Project', [
    'description' => 'This is a project',
    'issues_enabled' => false,
]);
```

### Self-Hosted GitLab

[](#self-hosted-gitlab)

```
$client = new Gitlab\Client();
$client->setUrl('https://git.yourdomain.com');
$client->authenticate('your_http_token', Gitlab\Client::AUTH_HTTP_TOKEN);
```

### Example with Pager

[](#example-with-pager)

```
$pager = new Gitlab\ResultPager($client);
$issues = $pager->fetchAll($client->issues(), 'all', [null, ['state' => 'closed']]);
```

### HTTP Client Builder

[](#http-client-builder)

By providing a `Gitlab\HttpClient\Builder` to the `Gitlab\Client` constructor, you can customize the HTTP client. For example, to customize the user agent:

```
$plugin = new Http\Client\Common\Plugin\HeaderSetPlugin([
    'User-Agent' => 'Foobar',
]);

$builder = new Gitlab\HttpClient\Builder();
$builder->addPlugin($plugin);

$client = new Gitlab\Client($builder);
```

One can read more about HTTPlug plugins [here](https://docs.php-http.org/en/latest/plugins/introduction.html#how-it-works). Take a look around the [API methods](https://github.com/GitLabPHP/Client/tree/11.2/src/Api), and please feel free to report any bugs, noting our [code of conduct](.github/CODE_OF_CONDUCT.md).

Contributing
------------

[](#contributing)

We will gladly receive issue reports and review and accept pull requests, in accordance with our [code of conduct](.github/CODE_OF_CONDUCT.md) and [contribution guidelines](.github/CONTRIBUTING.md)!

```
$ make install
$ make test

```

Security
--------

[](#security)

If you discover a security vulnerability within this package, please send an email to Graham Campbell at . All security vulnerabilities will be promptly addressed. You may view our full security policy [here](https://github.com/GitLabPHP/Client/security/policy).

License
-------

[](#license)

GitLab PHP API Client is licensed under [The MIT License (MIT)](LICENSE).

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 54.3% 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 ~35 days

Recently: every ~28 days

Total

87

Last Release

1707d ago

Major Versions

9.19.0 → 10.0.02020-08-15

9.19.1 → 10.0.12020-10-24

9.19.2 → 10.0.x-dev2020-10-26

10.4.0 → 11.0.02020-12-22

10.5.0 → 11.4.x-dev2021-08-20

PHP version history (5 changes)0.6.0PHP &gt;=5.3.2

9.0.0-beta1PHP ^5.6 || ^7.0

10.0.0-RC1PHP ^7.1

10.3.0PHP ^7.1.3 || ^8.0

11.0.0PHP ^7.2.5 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18551113?v=4)[Carlos Herrera](/maintainers/caherrera)[@caherrera](https://github.com/caherrera)

---

Top Contributors

[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (599 commits)")[![m4tthumphrey](https://avatars.githubusercontent.com/u/582971?v=4)](https://github.com/m4tthumphrey "m4tthumphrey (169 commits)")[![fbourigault](https://avatars.githubusercontent.com/u/1116116?v=4)](https://github.com/fbourigault "fbourigault (110 commits)")[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (32 commits)")[![drumm](https://avatars.githubusercontent.com/u/39292?v=4)](https://github.com/drumm "drumm (19 commits)")[![tobiasetter](https://avatars.githubusercontent.com/u/24449919?v=4)](https://github.com/tobiasetter "tobiasetter (15 commits)")[![omarlopesino](https://avatars.githubusercontent.com/u/3202817?v=4)](https://github.com/omarlopesino "omarlopesino (13 commits)")[![gaooulong](https://avatars.githubusercontent.com/u/128565219?v=4)](https://github.com/gaooulong "gaooulong (13 commits)")[![Artistan](https://avatars.githubusercontent.com/u/801349?v=4)](https://github.com/Artistan "Artistan (12 commits)")[![sidneymarieanne](https://avatars.githubusercontent.com/u/23741257?v=4)](https://github.com/sidneymarieanne "sidneymarieanne (11 commits)")[![jubianchi](https://avatars.githubusercontent.com/u/327237?v=4)](https://github.com/jubianchi "jubianchi (11 commits)")[![radutopala](https://avatars.githubusercontent.com/u/647137?v=4)](https://github.com/radutopala "radutopala (9 commits)")[![donkidd](https://avatars.githubusercontent.com/u/325242?v=4)](https://github.com/donkidd "donkidd (8 commits)")[![violuke](https://avatars.githubusercontent.com/u/6420347?v=4)](https://github.com/violuke "violuke (7 commits)")[![jdecool](https://avatars.githubusercontent.com/u/433926?v=4)](https://github.com/jdecool "jdecool (7 commits)")[![gilmiriam](https://avatars.githubusercontent.com/u/26138458?v=4)](https://github.com/gilmiriam "gilmiriam (7 commits)")[![glaubinix](https://avatars.githubusercontent.com/u/442056?v=4)](https://github.com/glaubinix "glaubinix (6 commits)")[![glensc](https://avatars.githubusercontent.com/u/199095?v=4)](https://github.com/glensc "glensc (6 commits)")[![laurenzgamper](https://avatars.githubusercontent.com/u/2470546?v=4)](https://github.com/laurenzgamper "laurenzgamper (5 commits)")[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (5 commits)")

---

Tags

apigitlab

### Embed Badge

![Health badge](/badges/caherrera-php-gitlab-api/health.svg)

```
[![Health](https://phpackages.com/badges/caherrera-php-gitlab-api/health.svg)](https://phpackages.com/packages/caherrera-php-gitlab-api)
```

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[m4tthumphrey/php-gitlab-api

GitLab API v4 client for PHP

9485.4M64](/packages/m4tthumphrey-php-gitlab-api)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[darthsoup/php-whmcs-api

WHMCS API client for PHP

2317.3k4](/packages/darthsoup-php-whmcs-api)

PHPackages © 2026

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