How do I make a unique() field with the id of the resource?
I'm trying to perform a unique() validation on a TextInput, but I need the resource's ID. I'm using request('record') when I'm on the edit page but request('record') is empty.
2 Replies
like this
->unique(ignoreRecord: true)
you can check more from here https://filamentphp.com/docs/2.x/forms/validation#uniqueFilament
Validation - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
Thanks for your reply but I'm trying this
The TextInput(name) is inside a repeater with a role relationship. Role names cannot be repeated for one client, but other clients can have the same roles. However, with ignoreRecord:true, I am unable to perform that validation