Skip to content

Commit

Permalink
edit readme
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Aug 27, 2018
1 parent 55398e3 commit e14c9bc
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,36 @@ public function fields(Request $request)

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/).

## Administering tags in Nova

If you want to perform crud actions on the save tags, just create a Nova resource for it. Here's an example.

```php
namespace App\Nova;

use Illuminate\Http\Request;
use Laravel\Nova\Fields\Text;
use Spatie\Tags\Tag as TagModel;

class Tag extends Resource
{
public static $model = TagModel::class;

public static $title = 'name';

public static $search = [
'name',
];

public function fields(Request $request)
{
return [
Text::make('Name')->sortable(),
];
}
}
```

### Testing

``` bash
Expand Down

0 comments on commit e14c9bc

Please sign in to comment.