Asked by: Prafful Panwar
public static $updatePaymentRules = [
'issue_id' => 'required|exists:ws_issues,id',
'payment_status' => 'required|in:0,1',
'payment_mode' => 'required|in:1,2',
'payment_amount' => 'required|numeric',
'payment_date' => 'required_if:payment_status,==,1|date|before:today',
'date' => 'required_if:payment_status,==,0|date|after:today'
];
For payment_amount i need something like that
'payment_amount' => 'required_if:payment_status,==,1|numeric|sometimes|same_if:payment_mode,==,1:$payment'
Where
- $payment is variable and it will come from database
- payment_amount required when payment_status,==,1
- payment_amount should be exact of $payment sometimes only if payment_mode,==,1, i.e. Full Payment
- payment_amount should be Numeric
Thanks in Advance
No comments:
Post a Comment