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

ActiveLibrary[API Development](/categories/api)

adamgoose/gitlab
================

Laravel API Wrapper for GitLab CE

v0.1.1(11y ago)19656[2 PRs](https://github.com/adamgoose/gitlab/pulls)MITPHPPHP &gt;=5.4.0

Since Apr 25Pushed 11y ago5 watchersCompare

[ Source](https://github.com/adamgoose/gitlab)[ Packagist](https://packagist.org/packages/adamgoose/gitlab)[ RSS](/packages/adamgoose-gitlab/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Laravel API Wrapper for GitLab CE
=================================

[](#laravel-api-wrapper-for-gitlab-ce)

[GitLab](http://gitlab.org) offers git repository management, code reviews, issue tracking, activity feeds and wiki’s. Enterprises install GitLab on-premise and connect it with LDAP and Active Directory servers for secure authentication and authorization. A single GitLab server can handle more than 25,000 users but it is also possible to create a high availability setup with a multiple active servers.

This Laravel API Wrapper allows users to plug into their own GitLab Instance's API seamlessly and in an Eloquent-like manner.

API Documentation can be viewed [here](http://adamgoose.github.io/gitlab/master/), or for the develop branch [here](http://adamgoose.github.io/gitlab/develop/).

- [Installation](#installation)
- [Namespacing &amp; Aliases](#namespacing)
- [Usage](#usage)
- [GitLab CE API](#api)
- [Todo](#todo)

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

[](#installation)

Add `adamgoose/gitlab` to your `composer.json` file.

```
"require": {
    "laravel/framework": "4.1.*",
    ...
    "adamgoose/gitlab": "dev-master"
},

```

Next, register the `GitlabServiceProvider` in `app/config/app.php`'s `providers` array:

```
'providers' => array(
  ...
  'Adamgoose\Gitlab\GitlabServiceProvider',
),

```

Finally, you'll need to configure the API Wrapper to access your instance. Just run the following command, then update the file found at `app/config/packages/adamgoose/gitlab/config.php`.

```
php artisan config:publish adamgoose/gitlab

```

Detailed information about the config settings can be found in the config file's comments.

Namespacing &amp; Aliases
-------------------------

[](#namespacing--aliases)

Since the API Wrapper uses an Eloquent Model-like synax, it may be useful to access some of the classes statically from the root namespace. Because of this, we have aliased all of the classes according to the default settings in the config file. You are free to change these however you wish, but use caution with common model names, such as `User`, to avoid conflict with your Eloquent models.

As of now, the config file is the only source of these aliases. Thus, any classes or models that are added to the package in the future will not be aliased automatically. I will do my best to make reference to any updates that should be made to this array in the changelog.

Usage
-----

[](#usage)

Traversing through the API is quite simple. Eloquent users (which should be all of you!) should be quite familiar with this type of syntax.

Since the majority of the API is centered around Projects, most of your API calls will be originated from the Project model. To find a project, simply use the `find($id)` method on the `Project` model.

```
$project = Gitlab\Project::find(1);

```

> *Note:* This documentation will use the default model aliases configured in the config file. However, if you have updated any of these aliases, you'll need to adjust the examples accordingly. See the [Namespacing &amp; Aliases](#namespacing) section of this document.

Casting the Project model to a string (or echoing it) will return a JSON object of all of the information provided by the [GitLab CE API](#api).

From here, you can also obtain several of the relations associated with a Project.

```
$events         = $project->events;
$members        = $project->members;
$hooks          = $project->hooks;
$branches       = $project->branches;
$tags           = $project->tags;
$tree           = $project->tree;
$commits        = $project->commits;
$snippets       = $project->snippets;
$keys           = $project->keys;
$issues         = $project->issues;
$milestones     = $project->milestones;
$merge_requests = $project->merge_requests;

```

Each of these particular calls will return instances of [`Illuminate\Support\Collection`](https://github.com/laravel/framework/blob/4.1/src/Illuminate/Support/Collection.php) populated with te respective models.

> *Note:* If you feel the urge to call these as methods, by all means. i.e. `$project->events()`.

Many of these models are available for a single-fetch.

```
$member        = $project->member($id);
$hook          = $project->hook($id);
$branch        = $project->branch($name);
$commit        = $project->commit($sha);
$snippet       = $project->snippet($id);
$key           = $project->key($id);
$issue         = $project->issue($id); // Note that the $id passed to the issue() method is the global ID, not the project-specific ID that is presented to you in the web version
$milestone     = $project->milestone($id);
$merge_request = $project->merge_request($id);

```

These calls will return instances of the respective models.

More documentation about each of these models will be availble in the Wiki of this repository (eventually).

GitLab CE API
-------------

[](#gitlab-ce-api)

The GitLab API documentation can be dound at , or by browsing to `/help/api/README` on your personal GitLab instance.

Todo (before 1.0)
-----------------

[](#todo-before-10)

> This list is NOT prioritized.

- Enable recursive tree browsing
- Enable file downloads
- Enable archive downloads
- Create
- Update
- Delete
- Render API Documentation
- Add Exceptions
- Tests?

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~26 days

Total

2

Last Release

4377d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/57fcaf88725f82e8ec5a410e9b28c26b33f3a3793a0c8a920a1c694e7e4c773d?d=identicon)[adamgoose](/maintainers/adamgoose)

---

Top Contributors

[![adamgoose](https://avatars.githubusercontent.com/u/611068?v=4)](https://github.com/adamgoose "adamgoose (12 commits)")

### Embed Badge

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

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

###  Alternatives

[skagarwal/google-places-api

Google Places Api

1913.0M8](/packages/skagarwal-google-places-api)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1344.8k1](/packages/jasara-php-amzn-selling-partner-api)[grantholle/powerschool-api

A Laravel package to make interacting with PowerSchool less painful.

1715.6k1](/packages/grantholle-powerschool-api)

PHPackages © 2026

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