The custom validation rule is :
Validator::extend('greater_than', function($attribute, $value, $parameters) {
if (isset($parameters[0])) {
return intval($value) > intval($parameter[0]);
} else {
return false;
}
}
max_occupancy rule would then be:
'max_occupancy' => 'required|integer|max:100|greater_than:base_occupancy'
но возвращаемый массив «$parameters»: массив: 1 [▼ 0 => «base_occupancy»]. поэтому я не получаю значение base_occupancy для проверки условия "больше_чем".