Custom validation already has an explanation on what to do. It say return a string if your validation fail and return null if your validation is successful. The string you need to return is the error message. $model data contains the current record you are trying to add, so it’s for you to write your logic to do your test and then return the response accordingly.
Thanks for the prompt response, I tried with the classic Laravel logic but I was asking for a minimum example to understand exactly how to adapt the logic to Radsystems and get to personalizing with a message.
This is the very simple code used but it doesn’t work
private function validateAddPage($modeldata){
//validation logic here $modeldata[‘id_accessorio’] => ‘required|unique:accessoriobbligatori’
return null; }
private function validateAddPage($modeldata){
//validation logic here
$error_message = null;
if($modeldata['example_field'] == null) {
$error_message = "example_field is empty, please make sure you fill example_field as it is required";
}
return $error_message;
}