unique Validation two colums How do it

I have two columns I wanaa unique Validation in textinput
No description
No description
4 Replies
LeandroFerreira
LeandroFerreira9mo ago
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Alnuaimi
AlnuaimiOP9mo ago
I have two columns, if one value differs, OK, if the two values do not differ, Validation works
tinkypinky
tinkypinky9mo ago
'name' => [ 'required', 'unique:domains,name', Rule::unique('domains', 'name')->where('compliance_id', $this->input('compliance_id')), ],
Alnuaimi
AlnuaimiOP9mo ago
Where I can write this code I solved Forms\Components\TextInput::make('name') ->unique(modifyRuleUsing: function (Unique $rule, callable $get) { // $get callable is used return $rule ->where('compliance_id', $get('compliance_id')) ->where('name', $get('name')); }, ignoreRecord: true)
Want results from more Discord servers?
Add your server