Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Php Gitlab Api

Php Gitlab Api Laravel Package

m4tthumphrey/php-gitlab-api

Modern GitLab API v4 client for PHP 8.1–8.5. Provides a clean, feature-rich wrapper around GitLab endpoints with PSR-18 HTTP client and PSR-17 factories support, plus maintained releases, changelog, and strong community tooling.

View on GitHub
Deep Wiki
Context7

GitLab API v4 client for PHP

Frequently asked questions about Php Gitlab Api
How do I integrate this GitLab API client with Laravel for project management?
Use the `graham-campbell/gitlab` package, which provides Laravel service providers, facades, and Eloquent models. Install it via `composer require graham-campbell/gitlab`, publish the config with `php artisan vendor:publish`, and set your `GITLAB_TOKEN` and `GITLAB_URL` in `.env`. Then call `$projects = GitLab::projects()->all()` to list projects.
Does this package support OAuth2 authentication for GitLab SSO in Laravel?
Yes, the core `m4tthumphrey/php-gitlab-api` supports OAuth2, but the Laravel-specific `graham-campbell/gitlab` package primarily uses personal access tokens. For OAuth2, configure the client manually with your OAuth2 provider and handle token refreshes via Laravel’s session or cache.
What Laravel versions are compatible with this GitLab API client?
The package works with Laravel 9 and 10, as it relies on PSR-18 HTTP clients (like Guzzle) that Laravel natively supports. Ensure your Laravel app uses PHP 8.1–8.5, which aligns with the package’s requirements.
How do I handle pagination for large GitLab API responses in Laravel?
The client includes a `ResultPager` class to simplify pagination. Use it like `$projects = GitLab::projects()->allWithPagination();` to fetch paginated results. For Laravel queues, wrap paginated calls in a job to avoid timeouts.
Can I use this package for self-hosted GitLab instances?
Yes, set the `GITLAB_URL` in your `.env` to your self-hosted instance (e.g., `https://gitlab.yourdomain.com`). The package supports custom URLs and instance-specific APIs, but verify webhook reliability and rate limits for your setup.
What’s the best way to test GitLab API interactions in Laravel?
Mock HTTP responses using Laravel’s `Http::fake()` or libraries like VCR for recording. For unit tests, inject a mock PSR-18 client into the GitLab service container. Example: `Http::fake(['*' => Http::response(['id' => 1])]);`
Does this package support GitLab CI/CD pipeline triggers from Laravel?
Yes, use the `GitLab::projects()->pipelines()->create()` method to trigger pipelines. For Laravel queues, dispatch a job with the pipeline trigger logic to avoid blocking requests. Example: `PipelineTriggerJob::dispatch($projectId, $ref);`
What are the alternatives to this GitLab API package for Laravel?
Alternatives include the official `gitlab/gitlab-php` (less Laravel-friendly) or `spatie/laravel-gitlab` (simpler but less feature-rich). This package stands out for its PSR compliance, modern PHP support, and Laravel-specific integrations like facades and Eloquent models.
How do I customize the HTTP client (e.g., add retries or middleware) in Laravel?
Override the default client in the `GitLabServiceProvider`. Example: Bind a custom Guzzle client with middleware: `$client = new Client([ 'timeout' => 30, 'headers' => ['User-Agent' => 'MyApp/1.0'] ]);` and inject it into the GitLab client.
Are there any known limitations with GitLab’s API v4 coverage in this package?
The package covers ~90% of GitLab’s REST API v4 but lacks support for newer features like Webhooks v4 or GraphQL. Monitor GitLab’s API deprecations and check the [changelog](https://github.com/GitLabPHP/Client/releases) for updates. For unsupported endpoints, use raw HTTP requests via the PSR-18 client.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony