PHPackages                             authanram/laravel-flatfile - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. authanram/laravel-flatfile

ActivePackage[Authentication &amp; Authorization](/categories/authentication)

authanram/laravel-flatfile
==========================

WORK IN PROGRESS

1.0.2(4y ago)123MITPHPPHP ^8.1.4

Since Jun 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/authanram/laravel-flatfile)[ Packagist](https://packagist.org/packages/authanram/laravel-flatfile)[ Docs](https://authanram.com)[ GitHub Sponsors](https://github.com/authanram)[ RSS](/packages/authanram-laravel-flatfile/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (21)Versions (5)Used By (0)

authanram/laravel-flatfile
==========================

[](#authanramlaravel-flatfile)

[![CI](https://github.com/authanram/laravel-flatfile/actions/workflows/main.yml/badge.svg)](https://github.com/authanram/laravel-flatfile/actions/workflows/main.yml)

Eloquent flat file driver, on top of [Sushi 🍣](https://github.com/calebporzio/sushi).

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

[](#requirements)

PHP 8.1.4 or higher, [Laravel 9+](https://laravel.com/docs/9.x)

*Downward compatibility is already at the doorstep.*

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

[](#installation)

You can install the package via composer.

```
composer require authanram/laravel-flatfile
```

By default all files written by this package will be located at `storage_path('app/flatfile')`.

Publish the [package configuration](config/config.php):

```
php artisan vendor:publish --provider="Authanram\FlatFile\FlatFileServiceProvider"
```

Quickly examining the configuration file `config/flatfile.php` would be a good idea.

Usage Example
-------------

[](#usage-example)

Here's an example of how it can be used in a very basic way:

```
namespace App\Models;

use Authanram\FlatFile\FlatFileModel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Post extends Model
{
    use FlatFileModel;
    use SoftDeletes;

    protected $schema = [
        'title' => 'string',
        'body' => 'string',
        'published_at' => 'datetime',
    ];

    protected $fillable = [
        'title',
        'body',
        'published_at',
    ];
}
```

Somewhere else in your code:

```
use App\Models\Post;

Post::create([
    'title' => 'New package arrived: laravel-flatfile',
    'body' => 'Solving the issue of...',
    'published_at' => now()->addHour(),
])
```

This will store the following contents to `storage_path('app/flatfile/post/1.json')`:

```
{
    "id": 1,
    "title": "New package arrived: laravel-flatfile",
    "body": "Solving the issue of...",
    "published_at": "2022-06-26 11:29:27",
    "created_at": "2022-06-26 10:29:27",
    "updated_at": "2022-06-26 10:29:27",
    "deleted_at": null
}
```

The package ships a second serializer, supporting yaml, that would lead to the following file contents stored at `storage_path('app/flatfile/post/1.yaml')`:

```
id: 1
title: New package arrived: laravel-flatfile
body: Solving the issue of...
published_at: 2022-06-26 11:29:27
created_at: '2022-06-26 10:29:27'
updated_at: '2022-06-26 10:29:27'
deleted_at: null
```

Caveats
-------

[](#caveats)

- **`many-to-many` relationships are currently not supported**

    In order to facilitate a `many-to-many` relationship, please fall back to a regular DBMS supported by [Eloquent](https://laravel.com/docs/9.x/eloquent) or feel free to create [pull request](https://github.com/authanram/laravel-flatfile/pulls).

Contributing
------------

[](#contributing)

Please see the [contribution guide](https://github.com/authanram/laravel-flatfile/blob/master/.github/CONTRIBUTING.md)for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](https://github.com/authanram/laravel-flatfile/security/policy)on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Daniel Seuffer](https://github.com/authanram)
- [and Contributors](https://github.com/authanram/laravel-flatfile/graphs/contributors) ❤️

Special thanks to [Caleb Porzio](https://github.com/calebporzio), the author of the underlying package [Sushi 🍣](https://github.com/calebporzio/sushi).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/authanram/laravel-flatfile/blob/master/LICENSE.md)for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

3

Last Release

1466d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/39ce69cfcaec5f2934c28c9375c96225bdbb810cf436631fcfc486dcceab14a8?d=identicon)[authanram](/maintainers/authanram)

---

Top Contributors

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

---

Tags

flatfileauthanram

###  Code Quality

TestsPest

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/authanram-laravel-flatfile/health.svg)

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

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

59437.0k9](/packages/jeremy379-laravel-openid-connect)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3416.9k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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