Skip to content

Commit

Permalink
docs(README): added missing info about model set up
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Frey <[email protected]>
  • Loading branch information
lukas-frey committed Apr 17, 2023
1 parent 2ecb13a commit 2fe6a34
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ You can install the package with composer:
### 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:
At the very least you need to add the HasDrafts (please note this is a modified trait) trait to your model:
```php
use Oddvalue\Drafts\HasDrafts;
use Guava\FilamentDrafts\Concerns\HasDrafts;

class Post extends Model
{
Expand All @@ -53,6 +53,8 @@ return new class extends Migration
}
```

NOTE: If you use the HasDrafts trait from Laravel Drafts, make sure you have defined `is_published` in your $fillable properties.

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

### Resource Trait
Expand Down

0 comments on commit 2fe6a34

Please sign in to comment.