Download the PHP package digitonic/eloquent-driver without Composer
On this page you can find all versions of the php package digitonic/eloquent-driver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download digitonic/eloquent-driver
More information about digitonic/eloquent-driver
Files in digitonic/eloquent-driver
Package eloquent-driver
Short Description Allows you to store Statamic data in a database.
License
Informations about the package eloquent-driver
Statamic Eloquent Driver
This package provides support for storing your Statamic data in a database rather than the filesystem.
This driver currently supports entries but not taxonomies, navigations, globals, or form submissions. We'll be working on those in the future.
Installation
Install using Composer:
Publish the config file:
Since Statamic uses UUIDs within content files by default, we provide two solutions depending on whether you need to use existing content.
Fresh install of statamic/statamic (using incrementing ids)
If you're starting from scratch, we can use traditional incrementing integers for IDs.
- Delete
content/collections/pages/home.md
- Change the structure
tree
incontent/collections/pages.yaml
to{}
. - Copy the
create_entries_table
migration intodatabase/migrations
. - Run
php artisan migrate
.
Starting from an existing site (using UUIDs)
If you're planning to use existing content, we can use the existing UUIDs. This will prevent you from needing to update any data or relationships.
- In the
config/statamic-eloquent-driver.php
file, changemodel
toUuidEntryModel
. - Copy the
create_entries_table_with_strings
migration intodatabase/migrations
. - Run
php artisan migrate
. - Import entries into database with
php please eloquent:import-entries
.
Storing Users in a Database
Statamic has a built-in users eloquent driver if you'd like to cross that bridge too.
Known issues
When saving a collection or reordering entries, the URIs of all entries in the collection will be updated, even if they haven't changed. This is an intensive operation and is being addressed in a future version of Statamic core.