how can i update the status id column of the model when it has pending modifications.
something like this:
protected function requiresApprovalWhen(array $modifications) : bool{ $fields_approval = [ 'id', 'partner_id', 'service_id', 'policy_no', 'policy_code', 'effective_date', 'expiry_date', 'issuing_date', 'renewal_duration', 'sum_insured', 'gross_premium', 'net_premium', 'is_renewable', 'is_flat_commissioned', 'flat_commission_rate', 'status_id','currency_id', ]; foreach($modifications as $key =>$modification){ if(in_array($key,$fields_approval)){ // Update the model status_id column logic here return true; } } // Handle some logic that determines if this change requires approval // // Return true if the model requires approval, return false if it // should update immediately without approval. return false; }
the modifications array doesn't contain the model id
how can i update the status id column of the model when it has pending modifications. something like this:
protected function requiresApprovalWhen(array $modifications) : bool{ $fields_approval = [ 'id', 'partner_id', 'service_id', 'policy_no', 'policy_code', 'effective_date', 'expiry_date', 'issuing_date', 'renewal_duration', 'sum_insured', 'gross_premium', 'net_premium', 'is_renewable', 'is_flat_commissioned', 'flat_commission_rate', 'status_id','currency_id', ]; foreach($modifications as $key =>$modification){ if(in_array($key,$fields_approval)){ // Update the model status_id column logic here return true; } } // Handle some logic that determines if this change requires approval // // Return true if the model requires approval, return false if it // should update immediately without approval. return false; }
the modifications array doesn't contain the model id