Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel 8 validation unique 2 columns

// in my case, just add more unique rule
'phone1' =>'string|unique:tbl_users,phone1|unique:tbl_users,phone2|different:phone2|min:2',
'phone2' =>'string|unique:tbl_users,phone2|unique:tbl_users,phone1|different:phone1|min:2',
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #validation #unique #columns
ADD COMMENT
Topic
Name
7+9 =