PHPackages                             roelofjan-elsinga/flat-file-cms - 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. roelofjan-elsinga/flat-file-cms

Abandoned → [roelofjan-elsinga/aloia-cms](/?search=roelofjan-elsinga%2Faloia-cms)Library[File &amp; Storage](/categories/file-storage)

roelofjan-elsinga/flat-file-cms
===============================

A drop-in flat file CMS for Laravel.

4.4.2(1y ago)18628919[2 issues](https://github.com/roelofjan-elsinga/aloia-cms/issues)[2 PRs](https://github.com/roelofjan-elsinga/aloia-cms/pulls)MITPHPPHP ^8.1|^8.2CI passing

Since Jun 19Pushed 1y ago4 watchersCompare

[ Source](https://github.com/roelofjan-elsinga/aloia-cms)[ Packagist](https://packagist.org/packages/roelofjan-elsinga/flat-file-cms)[ GitHub Sponsors](https://github.com/roelofjan-elsinga)[ Patreon](https://www.patreon.com/roelofjanelsinga)[ RSS](/packages/roelofjan-elsinga-flat-file-cms/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (10)Versions (83)Used By (0)

Aloia CMS
=========

[](#aloia-cms)

[![CI](https://github.com/roelofjan-elsinga/aloia-cms/actions/workflows/ci.yml/badge.svg)](https://github.com/roelofjan-elsinga/aloia-cms/actions/workflows/ci.yml)[![StyleCI Status](https://camo.githubusercontent.com/628af68b79567c45f914a8a779045dbaca194ca64594a719bdd0746bd4c3c290/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3139323737383134322f736869656c64)](https://github.styleci.io/repos/192778142)[![Code Coverage](https://camo.githubusercontent.com/656c8adf0e51f524eaf1f264c72abcdde4aca3098334b006c3bee814f4ef3a4d/68747470733a2f2f636f6465636f762e696f2f67682f726f656c6f666a616e2d656c73696e67612f616c6f69612d636d732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/roelofjan-elsinga/aloia-cms)[![Total Downloads](https://camo.githubusercontent.com/c63b6fef886f257152d2968153ef15820c0ee5041d657cb818178797118144c1/68747470733a2f2f706f7365722e707567782e6f72672f726f656c6f666a616e2d656c73696e67612f616c6f69612d636d732f646f776e6c6f616473)](https://packagist.org/packages/roelofjan-elsinga/aloia-cms)[![Latest Stable Version](https://camo.githubusercontent.com/0974547af3852bc075ee521ab7267eeab9c85510140038862ec240eeb81cc558/68747470733a2f2f706f7365722e707567782e6f72672f726f656c6f666a616e2d656c73696e67612f616c6f69612d636d732f762f737461626c65)](https://packagist.org/packages/roelofjan-elsinga/aloia-cms)[![License](https://camo.githubusercontent.com/c9cc3df52c227f2a9c46f97dae98cba5be11087e1a7dd03fb04e472d6f3abcbb/68747470733a2f2f706f7365722e707567782e6f72672f726f656c6f666a616e2d656c73696e67612f616c6f69612d636d732f6c6963656e7365)](https://packagist.org/packages/roelofjan-elsinga/aloia-cms)

This package contains a drop-in CMS that uses files to store its contents.

For the full documentation, go to the [Aloia CMS Documentation](https://aloiacms.com/documentation) website.

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

[](#installation)

You can include this package through Composer using:

```
composer require roelofjan-elsinga/aloia-cms
```

and if you want to customize the folder structure, then publish the configuration through:

```
php artisan vendor:publish --provider="AloiaCms\\AloiaCmsServiceProvider"
```

Creating a custom content type
------------------------------

[](#creating-a-custom-content-type)

Creating a custom content type is very simple. All you have to do is create a class that extends `AloiaCms\Models\Model`, specify a `$folder_path`, and optionally add required fields to `$required_fields`. An example can be found below:

```
namespace App\Models;

use AloiaCms\Models\Model;

class PortfolioItem extends Model
{
    protected $folder = 'portfolio_items';

    protected $required_fields = [
        'name',
        'github_url',
        'description',
    ];
}
```

Once you have a class like this, you can interact with it like described under "Usage of models"

Built-in models
---------------

[](#built-in-models)

There are 4 built-in models which you can use without any additional set-up:

- Page
- Article
- ContentBlock
- MetaTag

Of course, you can add your own models as described at "Creating a custom content type".

Usage of models
---------------

[](#usage-of-models)

In this example we're looking at one of the built-in content types: Article. You can use these same steps for all classes that extend from "AloiaCms\\Models\\Model".

To load all articles in the "articles" folder in the folder you specified in `config('aloiacms.collection_path')` you can use the following script:

```
use AloiaCms\Models\Article;

/**@var Article[]*/
$articles = Article::all();
```

You can use that to display your posts on a page. You can also load a single post, using:

```
$post_slug = 'this-post-is-amazing';

$article = Article::find($post_slug);
```

If you only want all published posts, you'll need to retrieve them like so:

```
$published_articles = Article::published();
```

To get the raw contents of each article (content + front matter), you can use:

```
$post_slug = 'this-post-is-amazing';

$articles = Article::find($post_slug)->rawContent();
```

And finally, to update your article, you can run:

```
use Carbon\Carbon;

$post_slug = 'this-post-is-amazing';

Article::find($post_slug)
    ->setExtension('md') // md is the default, but you can use html as well.
    ->setMatter([
        'description' => 'This post is about beautiful things',
        'is_published' => true,
        'is_scheduled' => false,
        // Either use post_date in setMatter() or setPostDate()
        'post_date' => date('Y-m-d')
    ])
    ->setPostDate(Carbon::now())
    ->setBody('# This is the content of an article')
    ->save();
```

Content blocks
--------------

[](#content-blocks)

You can manage small content blocks for your website through this package.

The content of the blocks are stored in a folder called "content\_blocks" inside of the `config('aloiacms.collections_path')` folder.

You'll need to register the facade into your application, by placing the following line to your aliases in `config/app.php`:

```
'Block' => \AloiaCms\Facades\BlockFacade::class,
```

Now you can use the facade in your blade views by using:

```
{!! Block::get('content-file-name') !!}
```

This facade will look for a file in the folder you specified in `config('aloiacms.collections_path')`. The Facade will parse the contents of the file to HTML to be able to render it. If no file could be found, an empty string will be returned.

NOTE: You should not specify the extension of the filename you're passing to `Block::get()`. This will be parsed automatically.

Testing
-------

[](#testing)

You can run the included tests by running `./vendor/bin/phpunit` in your terminal.

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

[](#contributing)

If you'd like to contribute to the CMS directly, you can create PR's on this repository. If you'd like to contribute to the documentation, you can create PR's on the [repository for the documentation](https://github.com/roelofjan-elsinga/aloia-cms-website).

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance48

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 94.1% 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 ~27 days

Recently: every ~176 days

Total

79

Last Release

383d ago

Major Versions

0.16.2 → 1.0.0-alpha.12020-02-12

1.2.4 → 2.0.02020-03-25

2.0.0 → 3.0.02020-03-25

3.4.3 → 4.0.02022-04-30

PHP version history (7 changes)3.0.0PHP &gt;=7.2.5

3.2.0PHP &gt;=7.3.0

3.3.0PHP &gt;=7.4.0

3.4.3PHP &gt;=7.4|&gt;=8.0

4.0.0PHP &gt;=8.0

4.3.0PHP &gt;=8.1

4.4.0PHP ^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/2602444740bac106e338fc57a5d16b085ba02a9ca3d714c2106dccccbf97bba2?d=identicon)[roelofjanelsinga](/maintainers/roelofjanelsinga)

---

Top Contributors

[![roelofjan-elsinga](https://avatars.githubusercontent.com/u/9220754?v=4)](https://github.com/roelofjan-elsinga "roelofjan-elsinga (238 commits)")[![juliomotol](https://avatars.githubusercontent.com/u/21353103?v=4)](https://github.com/juliomotol "juliomotol (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (4 commits)")[![incredimike](https://avatars.githubusercontent.com/u/125589?v=4)](https://github.com/incredimike "incredimike (1 commits)")[![jesse-deboer](https://avatars.githubusercontent.com/u/14839421?v=4)](https://github.com/jesse-deboer "jesse-deboer (1 commits)")

---

Tags

hacktoberfestlaravelphplaravelfilecms

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/roelofjan-elsinga-flat-file-cms/health.svg)

```
[![Health](https://phpackages.com/badges/roelofjan-elsinga-flat-file-cms/health.svg)](https://phpackages.com/packages/roelofjan-elsinga-flat-file-cms)
```

###  Alternatives

[roelofjan-elsinga/aloia-cms

A drop-in flat file CMS for Laravel.

1864.2k4](/packages/roelofjan-elsinga-aloia-cms)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[erlandmuchasaj/laravel-file-uploader

A simple package to help you easily upload files to your laravel project.

128.7k](/packages/erlandmuchasaj-laravel-file-uploader)[zing/laravel-flysystem-obs

Flysystem Adapter for OBS

1211.2k](/packages/zing-laravel-flysystem-obs)

PHPackages © 2026

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