PHPackages                             optimistdigital/nova-drafts - 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. optimistdigital/nova-drafts

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

optimistdigital/nova-drafts
===========================

A Laravel Nova field that allows you to make drafts of your current resources.

1.1.8(3y ago)2946.7k↓34.2%9[4 issues](https://github.com/outl1ne/nova-drafts/issues)[3 PRs](https://github.com/outl1ne/nova-drafts/pulls)MITPHPPHP &gt;=7.1.0

Since Jan 9Pushed 3y ago3 watchersCompare

[ Source](https://github.com/outl1ne/nova-drafts)[ Packagist](https://packagist.org/packages/optimistdigital/nova-drafts)[ RSS](/packages/optimistdigital-nova-drafts/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (17)Used By (0)

Nova Drafts
===========

[](#nova-drafts)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ff404823649ea8b2843ee70dd1ef24696eab1f4ff100e5c9e7b2f305c261371b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f7074696d6973746469676974616c2f6e6f76612d6472616674732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/optimistdigital/nova-drafts)[![Total Downloads](https://camo.githubusercontent.com/381480b3a144bf3fe3875b8f8ebbb2395fd91e45b22b87576ec0f4feb4118864/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f7074696d6973746469676974616c2f6e6f76612d6472616674732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/optimistdigital/nova-drafts)

This [Laravel Nova](https://nova.laravel.com) field allows you to make drafts of your resources.

Features
--------

[](#features)

- **Create Drafts**
- **Unpublish resources** (disable them)
- **Artisan Command to create Migration**

Screenshots
-----------

[](#screenshots)

[![Detail View](./docs/nova-drafts-details-view.png)](./docs/nova-drafts-details-view.png)

[![Form View](./docs/nova-drafts-form-view.png)](./docs/nova-drafts-form-view.png)

[![Index View](./docs/nova-drafts-index-view.png)](./docs/nova-drafts-index-view.png)

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

[](#installation)

Install the package in a Laravel Nova project via Composer:

```
composer require optimistdigital/nova-drafts
```

Usage
-----

[](#usage)

### Preparing the models and database

[](#preparing-the-models-and-database)

This field requires a few database changes - namely, the model requires three new columns **Migrations can be created using the following Artisan command:**

```
php artisan drafts:migration {table?}
```

if table name is not provided, a choice of all available tables is provided.

**If your table has pre-existing Unique constraint:**It's recommended to add 'published' field to the unique constraint. More information inside the migration file.

### Defining the field

[](#defining-the-field)

```
use OptimistDigital\NovaDrafts\DraftButton;
use OptimistDigital\NovaDrafts\PublishedField;
use OptimistDigital\NovaDrafts\UnpublishButton;

public function fields(Request $request)
{
    return [
        UnpublishButton::make('Unpublish'),
        DraftButton::make('Draft'),
        PublishedField::make('State', 'published'),
    ]
}
```

### Index Filtering (IndexQuery)

[](#index-filtering-indexquery)

Inside your **Model** add the following snippet:

```
public function childDraft()
{
    return $this->hasOne(YourModelName::class, 'draft_parent_id', 'id');
}
```

Inside your **Index Query** use that function, to filter out published pages that have drafts:

```
public static function indexQuery(NovaRequest $request, $query)
{
    return $query->doesntHave('childDraft');
}
```

Options
-------

[](#options)

Possible option you can pass to the field using the option name as a function

OptionTypeDefaultDescription`draftsEnabled`booleantrueboolean whether drafts are enabled or notLocalization and text customization
-----------------------------------

[](#localization-and-text-customization)

The translation file(s) can be published by using the following publish command:

```
php artisan vendor:publish --provider="OptimistDigital\NovaDrafts\FieldServiceProvider" --tag="translations"
```

You can add your translations to `resources/lang/vendor/nova-drafts/` by creating a new translations file with the locale name (ie `et.json`) and copying the JSON from the existing `en.json`.

Credits
=======

[](#credits)

- [Kaspar Rosin](https://github.com/kasparrosin)
- [Mikk Õun](https://github.com/mikkoun)
- [Tarvo Reinpalu](https://github.com/tarpsvo)

License
=======

[](#license)

Nova Drafts is open-sourced software licensed under the [MIT license](https://github.com/optimistdigital/nova-drafts/blob/master/LICENSE.md)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 64.5% 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 ~87 days

Recently: every ~159 days

Total

13

Last Release

1278d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/386999?v=4)[Allan Tatter](/maintainers/allantatter)[@allantatter](https://github.com/allantatter)

![](https://www.gravatar.com/avatar/5c80ca2be0e3f88f4422fae771026154c71332ad8b4dde5ea4fd41807dbbabba?d=identicon)[KasparRosin](/maintainers/KasparRosin)

---

Top Contributors

[![Tarpsvo](https://avatars.githubusercontent.com/u/2018660?v=4)](https://github.com/Tarpsvo "Tarpsvo (20 commits)")[![KasparRosin](https://avatars.githubusercontent.com/u/33309407?v=4)](https://github.com/KasparRosin "KasparRosin (7 commits)")[![jhonatasfender](https://avatars.githubusercontent.com/u/12156037?v=4)](https://github.com/jhonatasfender "jhonatasfender (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![liorocks](https://avatars.githubusercontent.com/u/534610?v=4)](https://github.com/liorocks "liorocks (1 commits)")

---

Tags

laravelfieldnovaoptimistdigitaldrafts

### Embed Badge

![Health badge](/badges/optimistdigital-nova-drafts/health.svg)

```
[![Health](https://phpackages.com/badges/optimistdigital-nova-drafts/health.svg)](https://phpackages.com/packages/optimistdigital-nova-drafts)
```

###  Alternatives

[timothyasp/nova-color-field

A Laravel Nova Color Picker field.

781.6M5](/packages/timothyasp-nova-color-field)[alexwenzel/nova-dependency-container

A Laravel Nova 4 form container for grouping fields that depend on other field values.

461.0M2](/packages/alexwenzel-nova-dependency-container)[sietse85/nova-button

(Nova 4+) A Laravel Nova package for adding buttons to your resources.

37347.3k](/packages/sietse85-nova-button)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

51174.8k1](/packages/inspheric-nova-defaultable)[optimistdigital/nova-notes-field

This Laravel Nova package adds a notes field to Nova's arsenal of fields.

52139.5k](/packages/optimistdigital-nova-notes-field)[outl1ne/nova-color-field

A Laravel Nova Color Picker field.

26249.4k](/packages/outl1ne-nova-color-field)

PHPackages © 2026

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