Spatie tag name text input field
Hello all, I have created a resource for the spatie tag model:
I want the user to be able to change the name of the tag, the problem is that it is saved like the following: {"nl": "test"}. So with the above code I get [object Object], and when I try to submit it, I get the following errror:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'database.name' doesn't exist.
Then I tried to do the form like this.
This did fill the field with the string I wanted it to fill with, but still the same error ocurs.
Any help would be really appreciated.
4 Replies
Are you using the original model or a new model?
@toeknee im using the original model
spatie tags uses
HasTranslations
by default for the slug and the name
public array $translatable = ['name', 'slug'];
so you may need to install
https://larazeus.com/translatableFound the solution I was stupid and it was because of the unique, the name and tags should be the other way around.