Skip to content

An example package that allows you to store Statamic entries in a database.

Notifications You must be signed in to change notification settings

statamic/eloquent-entries-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Statamic Eloquent Entries Example

⚠️ This repository is intended to be a learning tool, and not used in production.

This is built in a walkthrough on the Statamic Knowledge Base.

A package intended for real usage exists at statamic/eloquent-driver.

Installation

  • Clone or download this repository.
  • Add a repository in your project's composer.json pointing to where you cloned it:
    "repositories": [
        {
            "type": "path",
            "url": "path/to/repo"
        }
    ]
  • Require it with composer require statamic/eloquent-entries-example
  • Run migrations with php artisan migrate

Schema

Most of the entries' blueprint fields are in a catch-all JSON data column. This allows us to not need to update the DB schema when you change the blueprint.

The id and origin_id columns are strings, to make migrating from files easier. If they were incrementing integers, you'd need to update anywhere the IDs are referenced. Relationship field values, collections' mount values, structures, etc.

About

An example package that allows you to store Statamic entries in a database.

Resources

Stars

Watchers

Forks

Languages