is there anyway to validate incoming unixtime's parameter to server and compare that second one is greather that first one by laravel validation? my code only validate date format
$this->validate($request, [
'start_date' => 'required|date',
'end_date' => 'required|date|after_or_equal:start_date',
]
A timestamp is a number and can be anything between 0
and 2147483647
. That's all you can validate. (And of course that one is bigger than the other.)
So, you could do the following:
$this->validate($request, [
'start_date' => 'required|numeric',
'end_date' => 'required|numeric|gte:start_date',
]);