attribute = $attribute; $value = is_array($value) ? $value : [$value]; $allow = true; foreach ($value as $key => $row) { if(!empty($row)) { $id = Hasher::decode('contracts', $row); $contract = Contract:: where('id', $id) ->first(); foreach ($contract->contract_obligation_list as $key => $row) { echo $row->status; if ($row->status != config('constants.contract_obligation.status.active')) { $allow = false; } } } } return $allow; } /** * Get the validation error message. * * @return string */ public function message() { return config('error_code.contract_done_error'); } }