diff --git a/CHANGELOG.md b/CHANGELOG.md index 330fe57..6f96484 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to `nova-sluggable` will be documented in this file +## 1.1.3 - 2019-07-21 + +- Vue component matches TextFields's functionality +- Fixes an issue occured when Slug field was used withouth any option (#6) + ## 1.1.2 - 2019-05-06 - Option to set triggering event diff --git a/README.md b/README.md index aed6bf4..9f7def2 100755 --- a/README.md +++ b/README.md @@ -24,8 +24,22 @@ Add a new `SluggableText` and a `Slug` field to your Nova Resource: use Drobee\NovaSluggable\SluggableText; use Drobee\NovaSluggable\Slug; -SluggableText::make('Title'); -Slug::make('Slug'); +class User extends Resource +{ + // ... + + public function fields(Request $request) + { + return [ + // ... + + SluggableText::make('Title'), + Slug::make('Slug'), + + // ... + ]; + } +} ``` When the user types a string in the `SluggableText` field the value is being sent the API to generate the slug and and then it sets the `Slug` field's value to the that. The slug is updated on every `key up` event, but it can be tied to `blur` event on the title field.