Skip to main content
Statamic’s Revisions feature allows you to create revisions (who would have guessed it), review and rollback to previous revisions of your content, and more.

Enabling

If you haven’t already, you will need to enable Statamic’s revisions feature in your .env:
STATAMIC_REVISIONS_ENABLED=true
Next, make sure to enable Runway’s “publish states” feature. This is a prerequisite for using revisions, it provides a way for models to be published or unpublished, much like entries.
config/runway.php
'resources' => [
    \App\Models\Order::class => [
        'name' => 'Orders',
        'published' => true, // Assumes the model has a `published` boolean column.
        'published' => 'active', // Otherwise, you can specify the column name.
    ],
],
Finally, add the revisions config option to your resource’s config:
config/runway.php
'resources' => [
    \App\Models\Order::class => [
        'name' => 'Orders',
        'published' => true,
        'revisions' => true,
    ],
],
Now, when you’re editing a model in the Control Panel, you’ll be able to save using Revisions and view the history of changes.

Storing Revisions in the Database

Out of the box, Statamic will store revisions in your project’s storage/statamic/revisions directory. However, if you’d prefer for Statamic to store revisions in the database instead, you can install the official Eloquent Driver and select the “Revisions” repository:
php please install:eloquent-driver