PHPackages                             mirkoschmidt/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. mirkoschmidt/gitlab

ActiveLibrary[API Development](/categories/api)

mirkoschmidt/gitlab
===================

A GitLab bridge for Laravel

4.2.0(7y ago)016MITPHPPHP ^7.0

Since Mar 14Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mirkoschmidt/laravel-gitlab)[ Packagist](https://packagist.org/packages/mirkoschmidt/gitlab)[ RSS](/packages/mirkoschmidt-gitlab/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (10)Versions (17)Used By (0)

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

[](#laravel-gitlab)

[![laravel-gitlab](https://cloud.githubusercontent.com/assets/499192/24038988/ed13ea72-0b03-11e7-9068-ad06ba660a72.png)](https://about.gitlab.com)

> A [GitLab](https://github.com/m4tthumphrey/php-gitlab-api) bridge for Laravel.

```
// 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/8ae8abd015373d2c80a10fc085ea489ec5aea242d931088b8b25500231cd0737/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f76696e6b6c612f6c61726176656c2d6769746c61622e7376673f7374796c653d666c6174)](https://codecov.io/github/vinkla/laravel-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)

Laravel GitLab is decoupled from any library sending HTTP requests (like Guzzle), instead it uses an abstraction called [HTTPlug](http://httplug.io) which provides the http layer used to send requests to exchange rate services. This gives you the flexibility to choose what HTTP client and PSR-7 implementation you want to use.

Read more about the benefits of this and about what different HTTP clients you may use in the [HTTPlug documentation](http://docs.php-http.org/en/latest/httplug/users.html). Below is an example using [Guzzle 6](http://docs.guzzlephp.org/en/latest/index.html):

```
$ composer require vinkla/gitlab php-http/guzzle6-adapter
```

Add the service provider to `config/app.php` in the `providers` array, or if you're using Laravel 5.5, this can be done via the automatic package discovery.

```
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)

[MIT](LICENSE) © [Vincent Klaiber](https://vinkla.com)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 94.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 ~84 days

Recently: every ~99 days

Total

16

Last Release

2802d ago

Major Versions

1.1.0 → 2.0.02015-07-01

2.6.0 → 3.0.02017-08-07

3.0.0 → 4.0.02017-08-23

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

2.6.0PHP ^7.0

### Community

Maintainers

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

---

Top Contributors

[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (133 commits)")[![mirkoschmidt](https://avatars.githubusercontent.com/u/17124174?v=4)](https://github.com/mirkoschmidt "mirkoschmidt (4 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (2 commits)")[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (1 commits)")[![mirko-jtl](https://avatars.githubusercontent.com/u/50579203?v=4)](https://github.com/mirko-jtl "mirko-jtl (1 commits)")

---

Tags

apilaravelgitlabgit

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[dragon-code/laravel-json-response

Automatically always return a response in JSON format

1118.6k1](/packages/dragon-code-laravel-json-response)[surface/laravel-webfinger

A Laravel package to create an ActivityPub webfinger.

113.8k](/packages/surface-laravel-webfinger)

PHPackages © 2026

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