如果第二个或第三个是假的,如何进入下一个参数事件?在我的情况下,gender
为false
但marital status
为true
,但它们停在gender
而未执行marital status
。如何让它继续下一个参数事件第二或第三个是false
?
public function creditScore($user, $basic_information)
{
$basic_information->birth_date ? dispatch(new CalculateAge($user)) : false;
$basic_information->dependents ? dispatch(new CalculateDependents($user)) : false;
$basic_information->education ? dispatch(new CalculateEducation($user)) : false;
$basic_information->gender ? dispatch(new CalculateGender($user)) : false;
$basic_information->marital_status ? dispatch(new CalculateMaritalStatus($user)) : false;
}
答案 0 :(得分:0)
使用
if (isset($basic_information->birth_date)) dispatch(new CalculateAge($user));