PHPackages                             benmag/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. [API Development](/categories/api)
4. /
5. benmag/gitlab

AbandonedArchivedLibrary[API Development](/categories/api)

benmag/gitlab
=============

A GitLab bridge for Laravel

2.5.1(9y ago)022MITPHPPHP ^5.6.4 || ^7.0

Since Mar 14Pushed 9y ago1 watchersCompare

[ Source](https://github.com/benmag/gitlab)[ Packagist](https://packagist.org/packages/benmag/gitlab)[ RSS](/packages/benmag-gitlab/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (7)Versions (12)Used By (0)

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

[](#laravel-gitlab)

[![laravel-gitlab](https://cloud.githubusercontent.com/assets/499192/7440610/e030579c-f0bf-11e4-8c78-fdf74626de2b.png)](https://cloud.githubusercontent.com/assets/499192/7440610/e030579c-f0bf-11e4-8c78-fdf74626de2b.png)

Laravel [GitLab](https://gitlab.com/) is a [GitLab](https://gitlab.com/) bridge for Laravel using the [GitLab API package](https://github.com/m4tthumphrey/php-gitlab-api).

```
// Fetch projects.
$gitlab->api('projects')->all();

// Create Issues.
$gitlab->api('issues')->create($id, $params);

// Want to use the facade?
GitLab::api('users')->show($id);
```

[![Build Status](https://camo.githubusercontent.com/4068371040b2f4de54a0e2f8b7198def6cbd81d9693f72fe257bf3fab14cf88f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f76696e6b6c612f6c61726176656c2d6769746c61622f6d61737465722e7376673f7374796c653d666c6174)](https://travis-ci.org/vinkla/laravel-gitlab)[![StyleCI](https://camo.githubusercontent.com/2e11e71dd8081579fff21f3274917eb48a1be78e5f16c369dd87c298f6d1e8c7/68747470733a2f2f7374796c6563692e696f2f7265706f732f33323233353036392f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/32235069)[![Coverage Status](https://camo.githubusercontent.com/858bf5268c58ac120ec5f81166c04cf7fd97287772a0d75c286f3d613f7ac24e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f76696e6b6c612f6769746c61622e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/vinkla/gitlab/code-structure)[![Quality Score](https://camo.githubusercontent.com/891b1ed97fcb5259f6033c2de9214d7858eca22e2c4bbc86daa60be1d5cd78ec/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f76696e6b6c612f6769746c61622e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/vinkla/gitlab)[![Latest Version](https://camo.githubusercontent.com/2e9793b289e18bac243bbe83d6ac2929188148af6c3629dccc315edb05c80235/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f76696e6b6c612f6769746c61622e7376673f7374796c653d666c6174)](https://github.com/vinkla/gitlab/releases)[![License](https://camo.githubusercontent.com/abfe1ec112d62c58ec77a9886f8efdb13314f07fd35c213206406c7b084e0dda/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f76696e6b6c612f6769746c61622e7376673f7374796c653d666c6174)](https://packagist.org/packages/vinkla/gitlab)

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

[](#installation)

Require this package, with [Composer](https://getcomposer.org/), in the root directory of your project.

```
composer require vinkla/gitlab
```

Add the service provider to `config/app.php` in the `providers` array.

```
Vinkla\GitLab\GitLabServiceProvider::class
```

If you want you can use the [facade](http://laravel.com/docs/facades). Add the reference in `config/app.php` to your aliases array.

```
'GitLab' => Vinkla\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.

#### 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.

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 [Graham Campbell's](https://github.com/GrahamCampbell) [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 repository. 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.

### Examples

[](#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:

```
// You can alias this in config/app.php.
use Vinkla\GitLab\Facades\GitLab;

GitLab::api('projects')->all();
// We're done here - how easy was that, it just works!

GitLab::api('users')->all(true);
// This example is simple and there are far more methods available.
```

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

```
use Vinkla\GitLab\Facades\GitLab;

// Writing this…
GitLab::connection('main')->api('projects')->all();

// …is identical to writing this
GitLab::api('projects')->all();

// and is also identical to writing this.
GitLab::connection()->api('projects')->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 inject the manager:

```
use Vinkla\GitLab\GitLabManager;

class Foo
{
	protected $gitlab;

	public function __construct(GitLabManager $gitlab)
	{
		$this->gitlab = $gitlab;
	}

	public function bar()
	{
		$this->gitlab->api('users')->all(true);
	}
}

App::make('Foo')->bar();
```

Documentation
-------------

[](#documentation)

There are other classes in this package that are not documented here. This is because the package is a Laravel wrapper of [the official GitLab package](https://github.com/m4tthumphrey/php-gitlab-api).

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 95.6% 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 ~49 days

Total

11

Last Release

3628d ago

Major Versions

1.1.0 → 2.0.02015-07-01

PHP version history (4 changes)1.0.0PHP &gt;=5.4.7

1.1.0PHP &gt;=5.5.9

2.3.1PHP ^5.5.9 || ^7.0

2.5.0PHP ^5.6.4 || ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/fa098d678f75a71bd0675c8ef8a021bd8fb5ac6a503319a86519672bdb63023e?d=identicon)[benmag](/maintainers/benmag)

---

Top Contributors

[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (86 commits)")[![benmag](https://avatars.githubusercontent.com/u/4386560?v=4)](https://github.com/benmag "benmag (3 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (1 commits)")

---

Tags

apilaravelgitlabgit

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M184](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k253.1k78](/packages/moonshine-moonshine)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)

PHPackages © 2026

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