• Drafts
  • Drafts
  • Drafts
  • Drafts
  • Drafts

Drafts

Plugin information

by Lukas Frey

Admin panel Layout Kit Action

This plugin adds the ability to manage your model's drafts and revisions in your filament resources.

Support

#drafts on Discord

Views

3412

License

MIT

Documentation

Filament Drafts

This plugin adds the ability to manage your model's drafts and revisions in your filament resources.

It's a filament implementation for Laravel Drafts.

Installation

You can install the package with composer:

composer require guava/filament-drafts

Usage

Model Trait

First make sure that you have correctly set-up a model to use drafts from Laravel Drafts.

At the very least you need to add a trait to your model:

use Oddvalue\Drafts\HasDrafts;
 
class Post extends Model
{
use HasDrafts;
}

After that, you need to add a few traits to your resource and resource pages:

Resource Trait

Add the Draftable trait to your Resource:

use Guava\FilamentDrafts\Admin\Resources\Concerns\Draftable;
 
class PostResource extends Resource
{
use Draftable;
}

Resource Pages

Add the respective Draftable trait to your Resource Pages: (Keep in mind that each page uses a different trait from another namespace)

Create Page

use Guava\FilamentDrafts\Admin\Resources\Pages\Create\Draftable;
 
class PostResource extends Resource
{
use Draftable;
}

Edit Page

use Guava\FilamentDrafts\Admin\Resources\Pages\Edit\Draftable;
 
class PostResource extends Resource
{
use Draftable;
}

List Page

use Guava\FilamentDrafts\Admin\Resources\Pages\List\Draftable;
 
class PostResource extends Resource
{
use Draftable;
}

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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