PHPackages                             nfragkos/eloquenty - 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. [Database &amp; ORM](/categories/database)
4. /
5. nfragkos/eloquenty

ActiveLibrary[Database &amp; ORM](/categories/database)

nfragkos/eloquenty
==================

Statamic addon that allows you to store specific collection entries into the database via Eloquent.

v3.0.3(6mo ago)109.2k↓33.3%4MITPHPPHP ^8.2.0|^8.3.0

Since Jan 30Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/nfragkos/statamic-eloquenty)[ Packagist](https://packagist.org/packages/nfragkos/eloquenty)[ RSS](/packages/nfragkos-eloquenty/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (45)Used By (0)

Eloquenty Statamic Addon
========================

[](#eloquenty-statamic-addon)

[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This package allows you to store entries for specific collections to the database via Laravel's Eloquent ORM.

**Structures are disabled for performance reasons.**

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

[](#requirements)

- PHP 8.2+
- Statamic v5

How it works
------------

[](#how-it-works)

Eloquenty uses Statamic Eloquent Driver () but with modifications that allows to use the driver for specific collections entries instead for every entry.

[![Screenshot 2021-01-27 162333](https://user-images.githubusercontent.com/11143495/106163609-09a72300-6192-11eb-9d04-8b67a405eb33.png)](https://user-images.githubusercontent.com/11143495/106163609-09a72300-6192-11eb-9d04-8b67a405eb33.png)Both standard and Eloquenty collections will be visible under `/cp/collections` but the Entries column will display the message "Managed by Eloquenty" for Eloquenty collections.

[![Screenshot 2021-01-27 162410](https://user-images.githubusercontent.com/11143495/106163445-d82e5780-6191-11eb-84ad-7c9207e8baf8.png)](https://user-images.githubusercontent.com/11143495/106163445-d82e5780-6191-11eb-84ad-7c9207e8baf8.png)Eloquenty collections are managed on a separate route `/cp/eloquenty/collections` which is a clone of `/cp/collections` route group with modifications to use the Entry and EntryRepository classes under Eloquenty\\Entries that uses Eloquent ORM. The Entry related classes and Controllers are extending the original Statamic classes.

There's a middleware that redirects from `/cp/collections/{collection}` to `/cp/eloquenty/collections/{collection}` when clicking to view Eloquenty collections under `/cp/collections`.

Collection modifications should be performed under the original `/cp/collections` route.

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

[](#installation)

You can install this package via composer using:

```
composer require nfragkos/eloquenty
```

The package will automatically register itself.

Post-Install
------------

[](#post-install)

1. Publish eloquenty config and migration files:

    `php artisan vendor:publish --provider="Eloquenty\ServiceProvider"`
2. Run `php artisan migrate` to create Eloquenty table.
    (Make sure laravel is configured properly and schema is created. See )
3. Create a new collection or enter existing collection handle in config/eloquenty.php:

    ```
    'collections' => [
        'blog',
    ],
    ```

    This means that the entries for blog collection will be handled by Eloquenty.
4. If you entered an existing collection to Eloquenty config, there's an import command to import entries to the database:

    ```
    php artisan eloquenty:import-entries blog
    ```

    Please delete your collection entries from the filesystem after you verify that entries are imported successfully.

Usage
-----

[](#usage)

Eloquenty now should be visible now under Content section of the navigation menu in Control Panel. CRUD for Eloquenty collections works the same way as standard collections.

### Antlers

[](#antlers)

In Antlers templates use the `eloquenty` tag instead of the collection tag for Eloquenty collections:

```
{{ eloquenty from="blog" limit="10" taxonomy:tags="demo|example" sort="date:desc" }}
    {{ title }}
{{ /eloquenty }}

```

### Data retrieval and manipulation

[](#data-retrieval-and-manipulation)

Calling the queryEntries() method of Collection repository, will return the correct QueryBuilder for Eloquenty collections:

```
\Statamic\Facades\Collection::find('blog')->queryEntries()

```

Alternatively you can use the Facade ***Eloquenty::repository()*** method or ***EloquentyEntry::query()*** to retrieve the instance of EntryRepository (implements `Statamic\Contracts\Entries\EntryRepository`):

```
Eloquenty\Facades\Eloquenty::repository()

```

```
Eloquenty\Facades\EloquentyEntry::query()

```

**Keep in mind that calling the whereCollection() method will fetch all entries in the table. You should use the query() method instead that returns the query builder instance to build your query.**

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Pull requests are welcome and will be fully credited.

1. Fork the repo and create your branch from `main` branch.
2. Update the README file if needed.
3. Make sure your code follows the PSR-2 coding standard.
4. Issue that pull request!

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

Credits
-------

[](#credits)

Many thanks to Statamic for the Eloquent driver and the awesome CMS ❤️

Coffee
------

[](#coffee)

If you like this addon please consider buying me a coffee:

[![paypal](https://camo.githubusercontent.com/e1ff554a09e8e92bef25abc553ff05b88f45afd695877cf12f3a46558ef65b2e/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e61746543435f4c472e676966)](https://www.paypal.com/donate/?hosted_button_id=YFYL64AN3GCEJ)

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance66

Regular maintenance activity

Popularity32

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 61.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 ~43 days

Recently: every ~153 days

Total

41

Last Release

198d ago

Major Versions

v0.9-beta.10 → v1.0.0.rc.12021-07-09

v1.3.2 → v2.0.0-beta.12023-05-17

v2.0.4 → v3.0.02024-05-21

PHP version history (3 changes)v0.9-beta.1PHP ^7.4 || ^8.0

v2.0.0-beta.1PHP ^8.0

v3.0.0PHP ^8.2.0|^8.3.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11143495?v=4)[Nikolas Fragkos](/maintainers/nfragkos)[@nfragkos](https://github.com/nfragkos)

---

Top Contributors

[![nfragkos](https://avatars.githubusercontent.com/u/11143495?v=4)](https://github.com/nfragkos "nfragkos (55 commits)")[![nfragkos-ttp](https://avatars.githubusercontent.com/u/118163000?v=4)](https://github.com/nfragkos-ttp "nfragkos-ttp (21 commits)")[![dryven-daniel](https://avatars.githubusercontent.com/u/124880567?v=4)](https://github.com/dryven-daniel "dryven-daniel (6 commits)")[![nikolas-m4m](https://avatars.githubusercontent.com/u/98466023?v=4)](https://github.com/nikolas-m4m "nikolas-m4m (5 commits)")[![Kakoushias](https://avatars.githubusercontent.com/u/17521562?v=4)](https://github.com/Kakoushias "Kakoushias (1 commits)")[![ckakoushiasttp](https://avatars.githubusercontent.com/u/123932908?v=4)](https://github.com/ckakoushiasttp "ckakoushiasttp (1 commits)")[![v-subz3r0](https://avatars.githubusercontent.com/u/110227654?v=4)](https://github.com/v-subz3r0 "v-subz3r0 (1 commits)")

### Embed Badge

![Health badge](/badges/nfragkos-eloquenty/health.svg)

```
[![Health](https://phpackages.com/badges/nfragkos-eloquenty/health.svg)](https://phpackages.com/packages/nfragkos-eloquenty)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11120.2M21](/packages/anourvalar-eloquent-serialize)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)[abbasudo/laravel-purity

elegant way to add filter and sort in laravel

514330.5k1](/packages/abbasudo-laravel-purity)[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

240173.5k2](/packages/dragon-code-laravel-deploy-operations)[stayallive/laravel-eloquent-observable

Register Eloquent model event listeners just-in-time directly from the model.

2928.9k7](/packages/stayallive-laravel-eloquent-observable)

PHPackages © 2026

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