PHPackages                             hyn/eloquent-markdown - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hyn/eloquent-markdown

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hyn/eloquent-markdown
=====================

Mix markdown, frontmatter and eloquent models to easily handle markdown files with meta information by treating them as objects.

1.1(9y ago)4143MITPHPPHP &gt;=7.0

Since Dec 14Pushed 9y ago1 watchersCompare

[ Source](https://github.com/hyn/eloquent-markdown)[ Packagist](https://packagist.org/packages/hyn/eloquent-markdown)[ RSS](/packages/hyn-eloquent-markdown/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (6)Versions (3)Used By (0)

Eloquent markdown
=================

[](#eloquent-markdown)

[![GitHub license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://raw.githubusercontent.com/hyn/eloquent-markdown/license.md)[![Latest Stable Version](https://camo.githubusercontent.com/08d599504fb43595f66c172fe8c64cc847a65853886d6371384b382ee1c7d22c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68796e2f656c6f7175656e742d6d61726b646f776e2e737667)](https://github.com/hyn/eloquent-markdown)[![Build Status](https://camo.githubusercontent.com/e37962744f969ed850982984cc871682668d9537e7bf044232f63d6e636f98a5/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f68796e2f656c6f7175656e742d6d61726b646f776e2f6d61737465722e7376673f6d61784167653d32353932303030267374796c653d666c61742d737175617265)](https://travis-ci.org/hyn/eloquent-markdown)[![Total Downloads](https://camo.githubusercontent.com/fe0e578e7d94de917dece23008becffbbbb83c801fa905e7944f470e88654836/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68796e2f656c6f7175656e742d6d61726b646f776e2e737667)](https://github.com/hyn/eloquent-markdown)[![Donate](https://camo.githubusercontent.com/0d6e4d8b50b5983a58205941b1a581b1305903393b7a39da574e3f60af3c7f5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617970616c2d646f6e6174652d79656c6c6f772e737667)](https://paypal.me/luceos)

Ever felt like your markdown files could use meta information.. And once you've added frontmatter logic, whether it would be amazing to handle those files more humanely..

So let's combine markdown files, frontmatter and eloquent!

That something like the below:

```
{
  "title": "Some elaborate .."
}
And of course your regular markdown nonsense.
```

Mutates into an object:

```
echo $page->title; // Some elaborate ..
echo $page->getRenderedMarkdown(); // And of course your regular markdown nonsense.
echo $page->getMarkdown(); // And of course your regular markdown nonsense.
$page->setMarkdown('Foojaa'); // Yes update
$page->markdown = 'Foobar'; // Or on the assigned property
$page->save(); // Write the file to disk, YES!
```

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

[](#installation)

```
composer require hyn/eloquent-markdown
```

Now create a model you want to use for markdown files:

```
class Page extends \Hyn\Eloquent\Markdown\Model
{}
```

And setup the filesystem and markdown parser resolution, add in AppServiceProvider or somewhere:

```
use Hyn\Eloquent\Markdown\Model;
use Hyn\Frontmatter\Parser;
use cebe\markdown\Markdown;

// ..

public function register() {
            Model::setMarkdownParser(new Parser(new Markdown));
            Model::setFilesystem($this->app->make('filesystem')->disk('content'));
}
```

> Set `content` to the disk you configured to load the markdown files from. Or instantiate your own filesystem instance.

Usage
-----

[](#usage)

So if you have a file `some/foo.md`, use `Page::find('some/foo.md');` to create a Page object, where any frontmatter meta information is stored as properties, the markdown contents are stored in the original state as the `markdown` property and the generated html is assigned to the `contents` attribute.

Other stuff that works:

- `save()`
- `delete()`
- update the markdown property to renew the rendered content property automatically

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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

2

Last Release

3485d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/504687?v=4)[Daniël Klabbers](/maintainers/Luceos)[@luceos](https://github.com/luceos)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hyn-eloquent-markdown/health.svg)

```
[![Health](https://phpackages.com/badges/hyn-eloquent-markdown/health.svg)](https://phpackages.com/packages/hyn-eloquent-markdown)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[wearepixel/laravel-cart

A cart implementation for Laravel

1355.6k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

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