Weave 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
Flysystem Gitlab Storage

Flysystem Gitlab Storage Laravel Package

royvoetman/flysystem-gitlab-storage

A Flysystem adapter for storing files in GitLab repositories via the Repository Files API v4. Configure it with a project ID, branch, base URL, and personal access token, plus an optional path prefix. Works with Flysystem 3 and includes a Laravel integration.

View on GitHub
Deep Wiki
Context7

A Flysystem adapter for storing files in a GitLab repository via the Repository (files) API v4. Use it to read, write, and manage files directly in a GitLab project branch, with support for private projects through personal access tokens and an optional path prefix to scope the filesystem.

  • Flysystem adapter implementing AdapterInterface, compatible with Laravel
  • GitLab Repository API v4 under the hood
  • Personal access token authentication for private projects
  • Configurable project ID, branch, and base URL for self-hosted instances
  • Optional path prefix to isolate files within a repository

Requires PHP 7.4+ and Flysystem 3; older Flysystem versions are supported by tagged releases.

Frequently asked questions about Flysystem Gitlab Storage
What is royvoetman/flysystem-gitlab-storage used for?
It is a Flysystem adapter that stores and manages files in a GitLab repository through the Repository Files API v4. In Laravel, it lets the Storage facade use a GitLab-backed disk without application code knowing about GitLab. It fits low-churn, version-controlled artifacts rather than high-volume object storage.
How do I install and configure the GitLab Flysystem adapter in Laravel?
Install the adapter with composer require royvoetman/flysystem-gitlab-storage. For Laravel disk integration, use the separate royvoetman/laravel-gitlab-storage package and configure project ID, branch, base URL, personal access token, and optional path prefix in config/filesystems.php. All values can come from environment variables, and the branch acts like the bucket for isolation.
Which Laravel and Flysystem versions does this package support?
Current adapter releases target Flysystem 3, which is the line that aligns with Laravel 9 and newer. Flysystem 1 and 2 users must pin older adapter versions such as 1.1.0 or 2.0.4. Check the Laravel bridge constraints before committing, because the bridge is a separate package and may lag behind.
Do I need a personal access token for a private GitLab project?
Yes. Private projects require a GitLab personal access token that can access the Repository Files API. Store the token in a secrets manager or environment variable, scope it to a service account with least privilege, and plan rotation. Public projects may not need the same authentication level, but the adapter constructor still takes a token argument.
Can I use this adapter for user uploads or high-write application storage?
Generally no. Every write becomes a commit on the configured branch, so high-frequency writes, sessions, and volume user uploads will bloat the repository and slow clones and CI. Use it for low-churn, version-controlled artifacts instead. If you need object storage semantics, use S3-compatible storage such as MinIO.
How does the adapter handle directories and folder creation?
GitLab's Repository Files API is Git-backed and does not have real directories. The adapter emulates directory creation with .gitkeep files according to its changelog. Listings are paginated tree walks, so deep or large directory structures can be slower than an object store.
Does royvoetman/flysystem-gitlab-storage support GitLab LFS for large files?
LFS support is not documented in the README or changelog; they describe Repository Files API usage only. Until you verify it explicitly, assume large files are committed into the repository proper. That makes LFS a question to test before relying on this adapter for multi-megabyte assets.
What are the main production risks of using GitLab as a filesystem backend?
Key risks include repository bloat from commit-per-write behavior, broad personal access token scope, API rate limiting, and concurrent write conflicts without file locking. The package is also single-maintainer with a small community, so plan to vendor or fork and pin it. Batch writes, cache listings, and add retry logic with exponential backoff.
How should I test a Laravel app that uses the GitLab storage disk?
The package does not advertise a dedicated testing fake, so keep application tests isolated from the real GitLab API. Use Flysystem's in-memory adapter or mock the GitLab HTTP client for adapter-level tests, and reserve a disposable GitLab project for integration checks. Avoid pointing CI at a shared production branch.
What alternatives should I consider before choosing a GitLab Flysystem adapter?
If the real requirement is keeping files inside your infrastructure, S3-compatible storage such as MinIO avoids repository-as-storage tradeoffs. If you need GitLab specifically, compare the separate Laravel bridge against writing a small Storage::extend driver around the adapter. Also consider whether version-controlled artifacts belong in Git or in an artifact registry.
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.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
adachsoft/php-code-style