PHPackages                             matchingood/laravel-eloquent-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. matchingood/laravel-eloquent-storage

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

matchingood/laravel-eloquent-storage
====================================

Eloquent model which manages files.

v0.3(1y ago)27.8k1[3 issues](https://github.com/matchingood/laravel-eloquent-storage/issues)[1 PRs](https://github.com/matchingood/laravel-eloquent-storage/pulls)MITPHP

Since Nov 27Pushed 1y ago11 watchersCompare

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

READMEChangelog (9)Dependencies (1)Versions (15)Used By (0)

laravel-eloquent-storage
========================

[](#laravel-eloquent-storage)

Eloquent model which manages files easily

```
$file = $request->file('file');
$userFile = new UserFile;
$userFile->saveFromUploadedFile($file);

$userFile->getContent(); // the content in the $file
```

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

[](#installation)

In your composer.json,

```
"matchingood/laravel-eloquent-storage": "^0.2.1"

```

Then you register EloquentStorage at config/app.php.

```
'providers' => [
    .
    .
    .
    MatchinGood\EloquentStorage\EloquentStorageServiceProvider::class
],

```

You can create the configuration file to execute

```
$ php artisan vendor:publish

```

Then you can configure app/eloquentstorage.php

Usage
-----

[](#usage)

First of all, you have to add 3 specific columns on the tables you want to let it manage file.

```
// original file name
$table->string('file_name');

// unique file name to avoid conflicting original names
$table->string('unique_file_name');

// directory to store directory information
// for using directory parameters on saveConent or saveUploadedFile
$table->string('directory');
```

Then, you can enable eloquet models to manage files by using `MatchinGood\EloquentStorage`.

```
class UserFile extends MatchinGood\EloquentStorage\EloquentStorage
{

}
```

There are 2 ways to store files through EloquentStorage.

```
$userFile = new UserFile;

// 1. store text
$userFile->saveContent('file name', 'content');

// 2. store uploaded file
$file = $request->file('file');
$userFile->saveFromUploadedFile($file);

// you can add root directory like below
// in this case with local driver,
// it's gonna be stored at storage/app/root/user_files/xxxxxx
$userFile->saveFromUploadedFile($file, 'root');
```

Then you can check the new record on the table and the new file you saved at `storage/user_files/xxxxxxx`.

This library also provides response macros.

```
$userFile = UserFile::find(1);

return response()->downloadEloquentStorage($userFile);
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance25

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 60.6% 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 ~377 days

Recently: every ~731 days

Total

9

Last Release

436d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0479ac7fe271c19abe3bcaee704544e6457a7cacff63f377e6706628c37d1183?d=identicon)[kota-inamori](/maintainers/kota-inamori)

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

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

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

---

Top Contributors

[![mg-inukai](https://avatars.githubusercontent.com/u/26814222?v=4)](https://github.com/mg-inukai "mg-inukai (20 commits)")[![takuseno](https://avatars.githubusercontent.com/u/5235131?v=4)](https://github.com/takuseno "takuseno (9 commits)")[![cosuke2000](https://avatars.githubusercontent.com/u/2775185?v=4)](https://github.com/cosuke2000 "cosuke2000 (2 commits)")[![khouki](https://avatars.githubusercontent.com/u/2796586?v=4)](https://github.com/khouki "khouki (1 commits)")[![mg-orikasa](https://avatars.githubusercontent.com/u/7248927?v=4)](https://github.com/mg-orikasa "mg-orikasa (1 commits)")

---

Tags

awslaravelphp

### Embed Badge

![Health badge](/badges/matchingood-laravel-eloquent-storage/health.svg)

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

###  Alternatives

[overtrue/laravel-filesystem-qiniu

A Qiniu storage filesystem for Laravel.

482229.7k16](/packages/overtrue-laravel-filesystem-qiniu)[rahulhaque/laravel-filepond

Use FilePond the Laravel way

261114.4k2](/packages/rahulhaque-laravel-filepond)[overtrue/laravel-filesystem-cos

A Cos storage filesystem for Laravel.

92128.4k7](/packages/overtrue-laravel-filesystem-cos)

PHPackages © 2026

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