PHPackages                             edrisaturay/laravel-kdrive - 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. edrisaturay/laravel-kdrive

ActiveLibrary

edrisaturay/laravel-kdrive
==========================

Infomaniak kDrive Storage driver for Laravel. Fork of infomaniak/laravel-kdrive, modernized for Flysystem v3 and Laravel 11/12/13.

00

Since Feb 5Pushed todayCompare

[ Source](https://github.com/edrisaturay/laravel-kdrive)[ Packagist](https://packagist.org/packages/edrisaturay/laravel-kdrive)[ RSS](/packages/edrisaturay-laravel-kdrive/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Laravel kDrive
==============

[](#laravel-kdrive)

An [Infomaniak kDrive](https://www.infomaniak.com/en/kdrive) Storage driver for Laravel, exposing kDrive as a standard `Storage` disk over WebDAV.

This is a fork of [`infomaniak/laravel-kdrive`](https://github.com/infomaniak/laravel-kdrive)by Nicolas Hedger, modernized for **Flysystem v3** and **Laravel 11/12/13** (the upstream package and its `infomaniak/flysystem-kdrive` adapter are abandoned and Flysystem v1 only).

Requirements
------------

[](#requirements)

- PHP `^8.2`
- Laravel `^11.0 | ^12.0 | ^13.0`

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

[](#installation)

Installed in this monorepo via a path repository in the root `composer.json`:

```
{
    "repositories": [
        { "type": "path", "url": "packages/edrisaturay/laravel-kdrive", "options": { "symlink": true } }
    ]
}
```

```
composer require edrisaturay/laravel-kdrive:*
```

The service provider is auto-discovered.

Configuration
-------------

[](#configuration)

Set your credentials in `.env`:

```
KDRIVE_ID=123456
KDRIVE_USERNAME=you@example.com
KDRIVE_PASSWORD=your-application-password
KDRIVE_PREFIX=
```

- **`KDRIVE_ID`** — your kDrive numeric id (the number after `/drive/` in the kDrive web app URL).
- **`KDRIVE_USERNAME`** — the email used to sign in to your Infomaniak account.
- **`KDRIVE_PASSWORD`** — an [application password](https://manager.infomaniak.com/v3/profile/application-password)(required when two-step authentication is enabled).
- **`KDRIVE_PREFIX`** — optional path within the drive to scope the disk to, e.g. `Common documents/uploads`.

Add the disk to `config/filesystems.php`:

```
'disks' => [
    // ...
    'kdrive' => [
        'driver'   => 'kdrive',
        'id'       => config('kdrive.id'),
        'username' => config('kdrive.username'),
        'password' => config('kdrive.password'),
        'prefix'   => config('kdrive.prefix'),
    ],
],
```

Optionally publish the package config:

```
php artisan vendor:publish --tag=kdrive-config
```

Usage
-----

[](#usage)

```
use Illuminate\Support\Facades\Storage;

Storage::disk('kdrive')->put('reports/june.pdf', $contents);
$contents = Storage::disk('kdrive')->get('reports/june.pdf');
```

It behaves like any other Laravel filesystem disk.

Filament integration
--------------------

[](#filament-integration)

Because `kdrive` is registered as a standard Laravel disk, any Filament v5 component that accepts a disk name works out of the box.

### `FileUpload` (opt-in per field)

[](#fileupload-opt-in-per-field)

```
use Filament\Forms\Components\FileUpload;

FileUpload::make('attachment')
    ->disk('kdrive')
    ->directory('uploads')
    ->visibility('private');
```

To make it the default for every `FileUpload` in a panel, add this to a service provider's `boot()` method:

```
use Filament\Forms\Components\FileUpload;

FileUpload::configureUsing(fn (FileUpload $component) => $component->disk('kdrive'));
```

### `SpatieMediaLibraryFileUpload`

[](#spatiemedialibraryfileupload)

```
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;

SpatieMediaLibraryFileUpload::make('gallery')
    ->collection('gallery')
    ->disk('kdrive');
```

Spatie Media Library integration
--------------------------------

[](#spatie-media-library-integration)

`spatie/laravel-medialibrary` is a first-class consumer of Laravel disks, so kDrive plugs in with a single environment variable — no code changes required.

### 1. Set the default media disk

[](#1-set-the-default-media-disk)

In `.env`:

```
MEDIA_DISK=kdrive
```

`config/media-library.php` already reads `env('MEDIA_DISK', 'public')`.

### 2. Per-model / per-collection override

[](#2-per-model--per-collection-override)

If you'd rather keep the default disk as `public` and only route specific collections to kDrive:

```
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media;

class Document extends Model implements HasMedia
{
    use InteractsWithMedia;

    public function registerMediaCollections(): void
    {
        $this->addMediaCollection('originals')->useDisk('kdrive');
    }
}
```

Attaching a file:

```
$document->addMedia($request->file('file'))->toMediaCollection('originals');
```

### 3. Conversions

[](#3-conversions)

If you generate image conversions and want them on a different (typically faster, local) disk, set:

```
MEDIA_CONVERSIONS_DISK=public
```

Media Library will store originals on `kdrive` and conversions on `public`.

### Notes &amp; caveats

[](#notes--caveats)

- kDrive is a WebDAV backend — expect noticeably higher latency than local/S3. For write-heavy workflows (e.g. lots of image conversions), consider using kDrive only for archival/originals and keeping conversions on a local/CDN disk.
- Public URLs: kDrive files are not publicly accessible by default. Use `Storage::disk('kdrive')->temporaryUrl(...)` only if you've implemented a signed-URL flow; otherwise stream files through a controller.
- Direct browser uploads (Livewire/Filament temporary uploads) still go through your app server first — the file lands on kDrive on the final `store` call, not on the initial temp upload.

Credits
-------

[](#credits)

- [Nicolas Hedger](https://github.com/infomaniak) — original `infomaniak/laravel-kdrive`.
- [Edrisa A Turay](mailto:edrisa@edrisa.com) — fork maintainer.

License
-------

[](#license)

The MIT License (MIT). See [LICENSE.md](LICENSE.md).

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/95329b757401f7d19594b60cf196fef575ef365863207549dd320a28d03172e7?d=identicon)[edrisaa.turay](/maintainers/edrisaa.turay)

---

Top Contributors

[![edrisaturay](https://avatars.githubusercontent.com/u/21174548?v=4)](https://github.com/edrisaturay "edrisaturay (2 commits)")[![nhedger](https://avatars.githubusercontent.com/u/649677?v=4)](https://github.com/nhedger "nhedger (2 commits)")

### Embed Badge

![Health badge](/badges/edrisaturay-laravel-kdrive/health.svg)

```
[![Health](https://phpackages.com/badges/edrisaturay-laravel-kdrive/health.svg)](https://phpackages.com/packages/edrisaturay-laravel-kdrive)
```

PHPackages © 2026

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