how to fix tag name showing up in search box spatie/tags
Using Spatie/tags, when filtering, it shows the full json stored in the name field (See screenshot). The tag name should just be the value of the json object, not the entire thing.
2 Replies
You are storing as json for the language string, so you are wanting to actually translate it by the looks of it.
You can use format state, but I would probably getAttributeUsing and return the value for the current langauge
You also don't need
->options(fn () => Tag::all()->pluck('name', 'id')->toArray())
when using relationships
could you remove options and try this?