Hello. Is it possible to use async custom rule for validating unique laravel rule (from database)?
I tried like this
this.form.validator().extend({'unique':[':attribute must be unique',async({value,validator,parameters})=>{letparametersArray=parameters[0].split(',');awaitaxios.post('/api/validator/unique',{table:parametersArray[0],field:parametersArray[1],value:value}).then(response=>{returntrue;}).catch(error=>{returnfalse;});}]});
But it doesn't work.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello. Is it possible to use async custom rule for validating unique laravel rule (from database)?
I tried like this
But it doesn't work.