isCorrectOwnership($data) && parent::areValidRules($data); return $isValid; } protected function isCorrectOwnership(array $data) { if (empty($data)) { return true; } $ownershipPercents = array_filter(array_column($data, 'ownershipPercent'), 'intval'); $min = 20; $max = 100; $validOwnershipPercents = array_filter( $ownershipPercents, function ($value) use($min,$max) { return ($value >= $min && $value <= $max); } ); if (array_diff($ownershipPercents, $validOwnershipPercents)) { $this->addError('Only beneficial owners with Ownership % at 20% and above can be entered.'); return false; } if (array_sum($validOwnershipPercents) > 100) { $this->addError('The sum of Ownership % must be less or equal 100'); return false; } return true; } }