PHPackages                             xrobau/laravel-sql-storage - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. xrobau/laravel-sql-storage

ActiveLibrary[File &amp; Storage](/categories/file-storage)

xrobau/laravel-sql-storage
==========================

Use MySQL as a filesystem.

v0.3(1y ago)21AGPL-3.0-or-laterPHP

Since Nov 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/xrobau/laravel-sql-storage)[ Packagist](https://packagist.org/packages/xrobau/laravel-sql-storage)[ RSS](/packages/xrobau-laravel-sql-storage/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Laravel Storage using MySQL
===========================

[](#laravel-storage-using-mysql)

This was created because I needed to store 10+m files, linked to 1m+ identifiers, and using NFS was unwieldy.

I threw this together in an afternoon. It's probably missing a bunch of stuff, including the ability to list directories.

Listing files is incomplete, but will be added shortly (hint: FileModel with a trailing slash on the path)

Basic Instructions
------------------

[](#basic-instructions)

### Install

[](#install)

`composer require xrobau/laravel-sql-storage`

### Run the migrations

[](#run-the-migrations)

`php artisan migrate`

It will make two tables - sqlstorage and sqlstorage\_blobstore.

Usage
-----

[](#usage)

```
// Everything is related to an individual uuid. Think of this as
// the base folder.
$uuid = 'a3b04866-99b4-4edd-a85f-b12727bdd2ca';

// The @var is just an IDE Hint
/** @var SqlStorageDriver $s */
$s = Storage::disk('database');
// If you don't set 'usingUuid' it'll throw.
$s->usingUuid($uuid);

// This is the filename you want to mess with
$filename = "this.is.fake.txt";
// Set it to some random contents
$contents = str_repeat(str_repeat("a", 100) . str_repeat("b", 100), 100);
$s->put($filename, $contents);

// Now you can test it
if (!$s->exists($filename)) {
    print "$filename does not exist?\n";
    exit;
};

$out = $s->get($filename);
if ($out !== $contents) {
    print "Output didn't match what was put in?\nOut: '$out'\nOrig: '$contents'\n";
    exit;
}

print "Size is " . $s->size($filename) . "\n";
$m = $s->getModel($filename);
print "Model is: " . json_encode($m) . "\n";
$s->delete($filename);

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance40

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 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 ~0 days

Total

3

Last Release

551d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dfc7e21ae5d8590a2463e6f18aec2cb2faf78aa758894227a2587f892cbfdd1d?d=identicon)[xrobau](/maintainers/xrobau)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/xrobau-laravel-sql-storage/health.svg)

```
[![Health](https://phpackages.com/badges/xrobau-laravel-sql-storage/health.svg)](https://phpackages.com/packages/xrobau-laravel-sql-storage)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15161.6M2.6k](/packages/illuminate-filesystem)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)[madnest/madzipper

Easier zip file handling for Laravel applications.

1382.3M6](/packages/madnest-madzipper)

PHPackages © 2026

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