diff --git a/README.md b/README.md index 8980094..3e25fb3 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,27 @@ public function fields(Request $request) } ``` +## Allowing only one tag + +If the user is only allowed to select one tag for your resource you can call the `single` method. + +```php +// in your Nova resource + +public function fields(Request $request) +{ + return [ + // ... + + Tags::make('Tags')->single(), + + // ... + ]; +} +``` + +The field will be rendered as a select form element. It will be populated by the names of the tags already saved. + ## Working with tags For more info on how to work with the saved tags, head over to [the docs of spatie/laravel-tags](https://docs.spatie.be/laravel-tags/). diff --git a/docs/screenshot.png b/docs/screenshot.png index 71bb267..18f4c34 100644 Binary files a/docs/screenshot.png and b/docs/screenshot.png differ