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

ActiveLibrary[API Development](/categories/api)

pselge-daparto/php-gitlab-api
=============================

GitLab API v4 client for PHP

10.1.3(5y ago)04MITPHPPHP ^7.1

Since Jun 18Pushed 5y agoCompare

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

READMEChangelog (2)Dependencies (16)Versions (68)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.

[![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)[![Packagist Downloads](https://camo.githubusercontent.com/ba4c9e91416e9223f5e627ef8a2da7feef18bc4db418132d85fb0b4e96c50d41/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7073656c67652d6461706172746f2f7068702d6769746c61622d6170693f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pselge-daparto/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/) - [pselge-daparto/php-gitlab-api](https://packagist.org/packages/pselge-daparto/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.1-7.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)

#### PHP 7.1+:

[](#php-71)

```
$ composer require pselge-daparto/php-gitlab-api:^10.1 php-http/guzzle6-adapter:^2.0.1 http-interop/http-factory-guzzle:^1.0

```

#### PHP 7.2+:

[](#php-72)

```
$ composer require pselge-daparto/php-gitlab-api:^10.1 guzzlehttp/guzzle:^7.0.1 http-interop/http-factory-guzzle:^1.0

```

### Framework Integration

[](#framework-integration)

#### Laravel 6+:

[](#laravel-6)

```
$ composer require graham-campbell/gitlab:^4.2 guzzlehttp/guzzle:^7.0.1 http-interop/http-factory-guzzle:^1.0

```

#### Symfony 4:

[](#symfony-4)

```
$ composer require zeichen32/gitlabapibundle:^5.0 symfony/http-client:^4.4 nyholm/psr7:^1.3

```

#### Symfony 5:

[](#symfony-5)

```
$ composer require zeichen32/gitlabapibundle:^5.0 symfony/http-client:^5.0 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/10.1/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  or Miguel Piedrafita 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

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~1 days

Total

68

Last Release

2027d ago

Major Versions

9.18.1 → 10.0.0-RC12020-07-22

9.19.0 → 10.0.02020-08-15

9.19.1 → 10.0.12020-10-24

9.19.x-dev → 10.0.x-dev2020-10-26

10.1.1 → 11.0.x-dev2020-10-26

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

9.0.0-beta1PHP ^5.6 || ^7.0

10.0.0-RC1PHP ^7.1

11.0.x-devPHP ^7.2.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/abf636891509203d3b37b3c7230416c99e5d4b502811961d591bfd0b83238846?d=identicon)[pselge-daparto](/maintainers/pselge-daparto)

---

Top Contributors

[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (498 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)")[![gaooulong](https://avatars.githubusercontent.com/u/128565219?v=4)](https://github.com/gaooulong "gaooulong (13 commits)")[![omarlopesino](https://avatars.githubusercontent.com/u/3202817?v=4)](https://github.com/omarlopesino "omarlopesino (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)")[![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)")[![pselge-daparto](https://avatars.githubusercontent.com/u/46315327?v=4)](https://github.com/pselge-daparto "pselge-daparto (7 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)")[![jdecool](https://avatars.githubusercontent.com/u/433926?v=4)](https://github.com/jdecool "jdecool (7 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)")[![glensc](https://avatars.githubusercontent.com/u/199095?v=4)](https://github.com/glensc "glensc (5 commits)")

---

Tags

apigitlab

### Embed Badge

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

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

GitLab API v4 client for PHP

9485.4M64](/packages/m4tthumphrey-php-gitlab-api)[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)
