Leave request form example - part of a module
I have a problem in this part only. I dont know how to handle in the input. I have table Events(event_type_id, from_date,to_date). I have inserted a new event_type_id is 2 - Blocked day from day 13 to 15.
I have a table LeaveRequest(leave_from_date, leave_to_date). But i create a leave request from 13 to 15, i have created successfully but not handle the exception that if the Event blocked day from 13 to 15 but i input in LeaveRequest is from 13 to 15, it must send error.
I use Laravel framework and in my LeaveRequest for handle input, i just handle the leave_status only
public function rules()
{
return $rules = [
'leave_status' => 'required|integer|between:0,3',
];
}
Is there anyway to handle error like this. Thank you. I have done for 5 days but no solution.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire