Hi,
Can I ask something. Is there a possibility in the Dashboard Admin Resource Table to verify (by query) an entered/selected value if it matches with a value in another table during an Insert or Update statement? F.e. in the CustomValidator or so:
Number::create("value_id")
->label("Something")
->sortable(true)
->validators([
CustomValidator::create()->validationFunction(function($value){
/////////////////////////////////////////////
// something to compare with
$q = get the value if it matches another table value (select second_value from some_table where parent_id = $value)
/////////////////////////////////////////////
if($value == $q["second_value"]){
return false;
} else {
return true;
}
})->errorMessage("La-di-da-di")
]),
With kind regards, Marloes