- Add PHP 8.5 support
- Add support for
symfony/options-resolver:^8.0 - Add sensitive parameter annotations for authentication, trigger tokens, and user passwords
- Add support for
forceinRepositories::createCommit - Add support for personal access tokens
- Add support for project access token filters and rotation
- Add support for project CI/CD job token scope endpoints
- Add support for project integrations, push rules, and remote mirror read endpoints
- Add support for permanent project removal and project restoration
- Add support for
Projects::updateDeployKey - Add support for
Projects::latestPipeline - Add support for additional parameters in
Projects::fork - Add support for
inputsinProjects::createPipeline - Add support for
job_inputsandjob_variables_attributesinJobs::play - Add support for
visibilityinGroups::all - Add support for
with_custom_attributesandwith_projectsinGroups::show - Add support for
last_activity_afterandlast_activity_beforeinGroups::projects - Add support for group hook endpoints
- Add support for date filters and
finished_atordering inDeployments::all - Add support for
Environments::stopStale - Add support for container registry endpoints
- Add support for
regexandsortinRepositories::branches - Add support for
Users::usersContributedProjects - Add support for
without_project_botsinUsers::all - Add support for additional filters and ordering options in
MergeRequests::all - Add support for listing merge requests associated with commits and deployments
- Add support for merge request dependency, merge train, removal, resource label event, and award emoji endpoints
- Correct merge request API parameter handling
- Correct project forks list parameter handling
- Fix recent list endpoints to rely on the result pager for pagination
- Fix
Projects::pipelinesdate filters to include time information
Client
GitLabPHPMIT更新放缓PHP 版 GitLab API v4 客户端,封装了仓库、合并请求、流水线等接口调用,省去手写 HTTP 请求和鉴权逻辑。
GitLab API v4 client for PHP
README 里没有找到可直接复制的安装命令,请到 README 或官方文档查看安装方式。
README 没有说明硬件要求。
项目说明
这个项目的说明还在生成中,先参考下面「最近发版」和 README。
- 12.1.012.1.0 (06/05/2026)最新正式版2026-05-06 · 2026-05-06 21:18 UTC
- 12.0.012.0.0 (23/02/2025)2025-02-23 · 2025-02-23 20:39 UTC
查看更新说明
- Add PHP 8.4 support
- Drop support for PHP earlier than 8.1
- Moved various param types to native PHP types
- 11.14.011.14.0 (17/03/2024)2024-03-17 · 2024-03-17 21:38 UTC
查看更新说明
- Add support for
php-http/cache-plugin:^2.0 - Add support for
'approved'statusinProject::events - Add support for
nameincreateReleaseandupdateRelease - Add support for date filtering to
GroupsMilestones::all() - Update
MergeRequests::allto use millisecond precision for date filters
- Add support for
- 11.13.011.13.0 (03/12/2023)2023-12-03 · 2023-12-03 22:42 UTC
查看更新说明
- Add support for
symfony/options-resolver:^7.0 - Add support for
statusandenvironmentinDeployments::all - Add support for
Groups::search,Projects::search, andSearch::all
- Add support for
- 11.12.011.12.0 (08/10/2023)2023-10-08 · 2023-10-08 14:28 UTC
查看更新说明
- Add PHP 8.3 support
- Add
Projects::updateProtectedBranchandProjects::updateApprovalsConfiguration - Add support for
environment_scopeinProjects::removeVariable - Add support for
filterinProjects::variable - Add support for
authorinRepositories::commits - Add support for additional parameters in
Projects::labelsandGroups::labels
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
GitLab PHP API Client
We present a modern GitLab API v4 client for PHP.

This is strongly based on php-github-api by KnpLabs. With this in mind, we now have very similar clients for:
- Bitbucket - bitbucket/client by Graham Campbell.
- GitHub - knplabs/github-api by KnpLabs.
- GitLab - m4tthumphrey/php-gitlab-api which is this package!
Check out the change log, releases, security policy, license, code of conduct, and contribution guidelines.
Installation
This version supports PHP 8.1-8.5. To get started, simply require the project using Composer. You will also need to install packages that "provide" psr/http-client-implementation and psr/http-factory-implementation.
Standard Installation
$ composer require "m4tthumphrey/php-gitlab-api:^12.1" "guzzlehttp/guzzle:^7.9.2"
Framework Integration
Laravel:
$ composer require "graham-campbell/gitlab:^8.1"
Symfony:
$ composer require "zeichen32/gitlabapibundle:^7.0"
We are decoupled from any HTTP messaging client by using PSR-7, PSR-17, PSR-18, and HTTPlug. You can visit HTTPlug for library users to get more information about installing HTTPlug related packages. The framework integration graham-campbell/gitlab is by Graham Campbell and zeichen32/gitlabapibundle is by Jens Averkamp.
General API Usage
$client = new Gitlab\Client();
// Choose one authentication method.
// Personal access token authentication
$client->authenticate('your_access_token', Gitlab\Client::AUTH_HTTP_TOKEN);
// OAuth2 authentication
// $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_access_level' => 'disabled',
]);
Self-Hosted GitLab
$client = new Gitlab\Client();
$client->setUrl('https://git.yourdomain.com');
$client->authenticate('your_access_token', Gitlab\Client::AUTH_HTTP_TOKEN);
Example with Pager
$pager = new Gitlab\ResultPager($client);
$issues = $pager->fetchAll($client->issues(), 'all', [null, ['state' => 'closed']]);
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. Take a look around the API methods, and please feel free to report any bugs, noting our code of conduct.
Contributing
We will gladly receive issue reports and review and accept pull requests, in accordance with our code of conduct and contribution guidelines!
$ make install
$ make test
Security
If you discover a security vulnerability within this package, please send an email to Graham Campbell at [email protected]. All security vulnerabilities will be promptly addressed. You may view our full security policy here.
License
GitLab PHP API Client is licensed under The MIT License (MIT).