Change requirements for report request
This commit is contained in:
parent
d123fea439
commit
76240fdbfb
1 changed files with 11 additions and 1 deletions
|
|
@ -33,8 +33,18 @@ class ProfitLossRequest extends Request
|
|||
'is_income_billed' => 'required|bail|bool',
|
||||
'is_expense_billed' => 'required|bail|bool',
|
||||
'include_tax' => 'required|bail|bool',
|
||||
'date_range' => 'required|bail|string',
|
||||
'date_range' => 'sometimes|string',
|
||||
'send_email' => 'bool',
|
||||
];
|
||||
}
|
||||
|
||||
public function prepareForValidation()
|
||||
{
|
||||
$input = $this->all();
|
||||
|
||||
if(!array_key_exists('date_range', $input))
|
||||
$input['date_range'] = 'all';
|
||||
|
||||
$this->replace($input);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue