PHPackages                             graham-campbell/gitlab - 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. [Framework](/categories/framework)
4. /
5. graham-campbell/gitlab

ActiveLibrary[Framework](/categories/framework)

graham-campbell/gitlab
======================

GitLab Is A GitLab Bridge For Laravel

v8.0.0(1y ago)141584.1k—2.2%27[1 PRs](https://github.com/GrahamCampbell/Laravel-GitLab/pulls)2MITPHPPHP ^8.1CI passing

Since Mar 18Pushed 1y ago4 watchersCompare

[ Source](https://github.com/GrahamCampbell/Laravel-GitLab)[ Packagist](https://packagist.org/packages/graham-campbell/gitlab)[ GitHub Sponsors](https://github.com/GrahamCampbell)[ Fund](https://tidelift.com/funding/github/packagist/graham-campbell/gitlab)[ RSS](/packages/graham-campbell-gitlab/feed)WikiDiscussions 8.0 Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (73)Used By (2)

Laravel GitLab
==============

[](#laravel-gitlab)

Laravel GitLab was created by, and is maintained by [Graham Campbell](https://github.com/GrahamCampbell), and is a [GitLab PHP API Client](https://github.com/GitLabPHP/Client) bridge for [Laravel](https://laravel.com/). It utilises my [Laravel Manager](https://github.com/GrahamCampbell/Laravel-Manager) package. Feel free to check out the [change log](CHANGELOG.md), [releases](https://github.com/GrahamCampbell/Laravel-GitLab/releases), [security policy](https://github.com/GrahamCampbell/Laravel-GitLab/security/policy), [license](LICENSE), [code of conduct](.github/CODE_OF_CONDUCT.md), and [contribution guidelines](.github/CONTRIBUTING.md).

[![Banner](https://user-images.githubusercontent.com/2829600/71477349-6131cd00-27e1-11ea-84b0-8b4e539c7ad7.png)](https://user-images.githubusercontent.com/2829600/71477349-6131cd00-27e1-11ea-84b0-8b4e539c7ad7.png)

[![Build Status](https://camo.githubusercontent.com/cfccbf30394dab2b1072e02a321d0d3e54396d9953fd1878f35219c3d8e104c8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f47726168616d43616d7062656c6c2f4c61726176656c2d4769744c61622f74657374732e796d6c3f6c6162656c3d5465737473267374796c653d666c61742d737175617265)](https://github.com/GrahamCampbell/Laravel-GitLab/actions?query=workflow%3ATests)[![StyleCI Status](https://camo.githubusercontent.com/b52974c512528132747051dc39ad4f38091f0ea604e3d10ea1627b6497e2e54c/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3132333732363337342f736869656c64)](https://github.styleci.io/repos/123726374)[![Software License](https://camo.githubusercontent.com/c090e080484e2a2bc766446291d04437db823929042bf614b26a1643660ddf6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e3f7374796c653d666c61742d737175617265)](LICENSE)[![Packagist Downloads](https://camo.githubusercontent.com/be2b7da6f48626be49bcfc8569444308ce303b16785b9f03658fe0a639ab04d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67726168616d2d63616d7062656c6c2f6769746c61623f7374796c653d666c61742d737175617265)](https://packagist.org/packages/graham-campbell/gitlab)[![Latest Version](https://camo.githubusercontent.com/59cde16c76359845e6df9997f0d3d262399ba2b1436e38193bc7c479fb753057/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f47726168616d43616d7062656c6c2f4c61726176656c2d4769744c61623f7374796c653d666c61742d737175617265)](https://github.com/GrahamCampbell/Laravel-GitLab/releases)

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

[](#installation)

This version requires [PHP](https://www.php.net/) 8.1-8.4 and supports [Laravel](https://laravel.com/) 10-12.

GitLabL5.5L5.6L5.7L5.8L6L7L8L9L10L11L121.10✅✅✅✅❌❌❌❌❌❌❌2.7✅✅✅✅✅✅❌❌❌❌❌3.3❌❌❌❌✅✅✅❌❌❌❌4.4❌❌❌❌✅✅✅❌❌❌❌5.6❌❌❌❌✅✅✅✅❌❌❌6.0❌❌❌❌❌❌✅✅❌❌❌7.6❌❌❌❌❌❌✅✅✅✅❌8.0❌❌❌❌❌❌❌❌✅✅✅To get the latest version, simply require the project using [Composer](https://getcomposer.org/):

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

Once installed, if you are not using automatic package discovery, then you need to register the `GrahamCampbell\GitLab\GitLabServiceProvider` service provider in your `config/app.php`.

You can also optionally alias our facade:

```
        'GitLab' => GrahamCampbell\GitLab\Facades\GitLab::class,
```

Configuration
-------------

[](#configuration)

Laravel GitLab requires connection configuration.

To get started, you'll need to publish all vendor assets:

```
$ php artisan vendor:publish
```

This will create a `config/gitlab.php` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

There are two config options:

##### Default Connection Name

[](#default-connection-name)

This option (`'default'`) is where you may specify which of the connections below you wish to use as your default connection for all work. Of course, you may use many connections at once using the manager class. The default value for this setting is `'main'`.

##### GitLab Connections

[](#gitlab-connections)

This option (`'connections'`) is where each of the connections are setup for your application. Example configuration has been included, but you may add as many connections as you would like. Note that the 4 supported authentication methods are: `"none"`, `"oauth"`, `"job_token"`, and `"token"`.

##### HTTP Cache

[](#http-cache)

This option (`'cache'`) is where each of the cache configurations setup for your application. Only the "illuminate" driver is provided out of the box. Example configuration has been included.

Usage
-----

[](#usage)

##### GitLabManager

[](#gitlabmanager)

This is the class of most interest. It is bound to the ioc container as `'gitlab'` and can be accessed using the `Facades\GitLab` facade. This class implements the `ManagerInterface` by extending `AbstractManager`. The interface and abstract class are both part of my [Laravel Manager](https://github.com/GrahamCampbell/Laravel-Manager) package, so you may want to go and checkout the docs for how to use the manager class over at [that repo](https://github.com/GrahamCampbell/Laravel-Manager#usage). Note that the connection class returned will always be an instance of `Gitlab\Client`.

##### Facades\\GitLab

[](#facadesgitlab)

This facade will dynamically pass static method calls to the `'gitlab'` object in the ioc container which by default is the `GitLabManager` class.

##### GitLabServiceProvider

[](#gitlabserviceprovider)

This class contains no public methods of interest. This class should be added to the providers array in `config/app.php`. This class will setup ioc bindings.

##### Real Examples

[](#real-examples)

Here you can see an example of just how simple this package is to use. Out of the box, the default adapter is `main`. After you enter your authentication details in the config file, it will just work:

```
use GrahamCampbell\GitLab\Facades\GitLab;
// you can alias this in config/app.php if you like

GitLab::groups()->all();
// we're done here - how easy was that, it just works!
```

The gitlab manager will behave like it is a `Gitlab\Client` class. If you want to call specific connections, you can do with the `connection` method:

```
use GrahamCampbell\GitLab\Facades\GitLab;

// writing this:
GitLab::connection('main')->groups()->all();

// is identical to writing this:
GitLab::groups()->all();

// and is also identical to writing this:
GitLab::connection()->groups()->all();

// this is because the main connection is configured to be the default
GitLab::getDefaultConnection(); // this will return main

// we can change the default connection
GitLab::setDefaultConnection('alternative'); // the default is now alternative
```

If you prefer to use dependency injection over facades like me, then you can easily inject the manager like so:

```
use GrahamCampbell\GitLab\GitLabManager;

class Foo
{
    public function __construct(
        private readonly GitLabManager $gitlab,
    ) {
    }

    public function bar()
    {
        $this->gitlab->groups()->all();
    }
}

app(Foo::class)->bar();
```

For more information on how to use the `Gitlab\Client` class we are calling behind the scenes here, check out the docs at , and the manager class at .

##### Further Information

[](#further-information)

There are other classes in this package that are not documented here. This is because they are not intended for public use and are used internally by this package.

Security
--------

[](#security)

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

License
-------

[](#license)

Laravel GitLab is licensed under [The MIT License (MIT)](LICENSE).

For Enterprise
--------------

[](#for-enterprise)

Available as part of the Tidelift Subscription

The maintainers of `graham-campbell/gitlab` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-graham-campbell-gitlab?utm_source=packagist-graham-campbell-gitlab&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance44

Moderate activity, may be stable

Popularity54

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 99.1% 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 ~36 days

Recently: every ~0 days

Total

72

Last Release

441d ago

Major Versions

3.3.x-dev → v4.0.02020-08-16

4.4.x-dev → v5.0.02020-12-22

5.6.x-dev → 6.0.x-dev2022-05-31

v6.0.0 → 7.0.x-dev2023-03-07

v7.6.0 → 8.0.x-dev2025-03-03

PHP version history (5 changes)v1.0.0PHP ^7.1.3

v3.0.0PHP ^7.2.5

4.3.x-devPHP ^7.2.5 || ^8.0

6.0.x-devPHP ^7.4.15 || ^8.0.2

8.0.x-devPHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (215 commits)")[![andrewminion-luminfire](https://avatars.githubusercontent.com/u/47227887?v=4)](https://github.com/andrewminion-luminfire "andrewminion-luminfire (1 commits)")[![spawnia](https://avatars.githubusercontent.com/u/12158000?v=4)](https://github.com/spawnia "spawnia (1 commits)")

---

Tags

hacktoberfestframeworklaravelgitlabGraham CampbellGrahamCampbellBridgephp-gitlab-apigitlab bridgeLaravel GitLab

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/graham-campbell-gitlab/health.svg)

```
[![Health](https://phpackages.com/badges/graham-campbell-gitlab/health.svg)](https://phpackages.com/packages/graham-campbell-gitlab)
```

###  Alternatives

[graham-campbell/github

GitHub Is A GitHub Bridge For Laravel

6411.7M19](/packages/graham-campbell-github)[graham-campbell/digitalocean

DigitalOcean Is A DigitalOcean Bridge For Laravel

509343.1k2](/packages/graham-campbell-digitalocean)[graham-campbell/bitbucket

Bitbucket Is A Bitbucket Bridge For Laravel

75185.0k2](/packages/graham-campbell-bitbucket)[graham-campbell/markdown

Markdown Is A CommonMark Wrapper For Laravel

1.3k7.1M64](/packages/graham-campbell-markdown)[graham-campbell/manager

Manager Provides Some Manager Functionality For Laravel

39221.1M134](/packages/graham-campbell-manager)[graham-campbell/throttle

Throttle Is A Rate Limiter For Laravel

7102.3M11](/packages/graham-campbell-throttle)

PHPackages © 2026

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