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

ActiveLibrary[API Development](/categories/api)

m4tthumphrey/php-gitlab-api
===========================

GitLab API v4 client for PHP

12.0.0(1y ago)9485.4M—1%458[5 issues](https://github.com/GitLabPHP/Client/issues)[18 PRs](https://github.com/GitLabPHP/Client/pulls)20MITPHPPHP ^8.1CI passing

Since Jun 18Pushed 9mo ago31 watchersCompare

[ Source](https://github.com/GitLabPHP/Client)[ Packagist](https://packagist.org/packages/m4tthumphrey/php-gitlab-api)[ GitHub Sponsors](https://github.com/GrahamCampbell)[ RSS](/packages/m4tthumphrey-php-gitlab-api/feed)WikiDiscussions 12.0 Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (112)Used By (20)

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/7849898c4a430d94123dec8a23198d3a54e68a29495a5973321823939eaad7fa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4769744c61625048502f436c69656e742f74657374732e796d6c3f6c6162656c3d5465737473267374796c653d666c61742d737175617265)](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) 8.1-8.4. 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:^12.0" "guzzlehttp/guzzle:^7.9.2"
```

### Framework Integration

[](#framework-integration)

#### Laravel:

[](#laravel)

```
$ composer require "graham-campbell/gitlab:^8.0"
```

#### Symfony:

[](#symfony)

```
$ composer require "zeichen32/gitlabapibundle:^7.0"
```

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/12.0/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

68

—

FairBetter than 100% of packages

Maintenance51

Moderate activity, may be stable

Popularity70

Solid adoption and visibility

Community51

Growing community involvement

Maturity89

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 58.9% 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 ~40 days

Recently: every ~129 days

Total

112

Last Release

273d ago

Major Versions

9.19.0 → 10.0.02020-08-15

9.19.1 → 10.0.12020-10-24

9.19.2 → 10.0.22020-10-26

10.4.x-dev → 11.0.02020-12-22

11.14.x-dev → 12.0.02025-02-23

PHP version history (7 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

11.7.0PHP ^7.4.15 || ^8.0.2

12.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d95eb26cb8f3919bb5ca3b6d823daeabbf259663778a970349b245c580713c8e?d=identicon)[graham-campbell](/maintainers/graham-campbell)

![](https://avatars.githubusercontent.com/u/582971?v=4)[Matt Humphrey](/maintainers/m4tthumphrey)[@m4tthumphrey](https://github.com/m4tthumphrey)

---

Top Contributors

[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (738 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)")[![jubianchi](https://avatars.githubusercontent.com/u/327237?v=4)](https://github.com/jubianchi "jubianchi (11 commits)")[![sidneymarieanne](https://avatars.githubusercontent.com/u/23741257?v=4)](https://github.com/sidneymarieanne "sidneymarieanne (11 commits)")[![donkidd](https://avatars.githubusercontent.com/u/325242?v=4)](https://github.com/donkidd "donkidd (10 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (10 commits)")[![jdecool](https://avatars.githubusercontent.com/u/433926?v=4)](https://github.com/jdecool "jdecool (9 commits)")[![radutopala](https://avatars.githubusercontent.com/u/647137?v=4)](https://github.com/radutopala "radutopala (9 commits)")[![violuke](https://avatars.githubusercontent.com/u/6420347?v=4)](https://github.com/violuke "violuke (7 commits)")[![gilmiriam](https://avatars.githubusercontent.com/u/26138458?v=4)](https://github.com/gilmiriam "gilmiriam (7 commits)")[![glensc](https://avatars.githubusercontent.com/u/199095?v=4)](https://github.com/glensc "glensc (6 commits)")[![glaubinix](https://avatars.githubusercontent.com/u/442056?v=4)](https://github.com/glaubinix "glaubinix (6 commits)")[![laurenzgamper](https://avatars.githubusercontent.com/u/2470546?v=4)](https://github.com/laurenzgamper "laurenzgamper (5 commits)")

---

Tags

apiapi-clientgitlabgitlab-apihttplugphpapigitlab

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/m4tthumphrey-php-gitlab-api/health.svg)](https://phpackages.com/packages/m4tthumphrey-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)[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)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)

PHPackages © 2026

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