Is there any problem if I delete a relation manager just by deleting the created file? Could this co
After seeing that a relation was wrong, I deleted the file and redid another one, and in this one I did it correctly and it was working well, however when using forms and saving data in my pivo table I saw that I can save the same id more than once, Could the problem be related to me having deleted the file manually?
5 Replies
Probably not related. If this should be a unique value you should make it unique in your database. Just make a new migration and add the unique to it. Laravel has good docs on that if you don’t already know how.
Also, you can add ->unique() to your input and Filament will also check. For unique IDs I recommend doing both.
thanks man, appreciate your help but I can't make it unique because it's a many to many relationship
I'll post the answer here once I solve this problem
Many to many is a little tricker for sure. If you can post more of the code I'd be happy to take a look if you don't solve it first.
I found the problem, I have missed a letter in my make-relation-manager, I wrote
php artisan make:filament-relation-manager FormularioResource cargo nome --attach'cargo' was supossed to be 'cargos' so I did a new relation and it's working fine thanks for the help @Chrispian
Good find! Thanks for sharing that you found it. I’ve done that so many times lol