In Laravel 4 I'm trying to find not confirmation validation for input values. For example with confirmation we can check matching password and repassword and now I want to check contrary of two values. for example A must be not equal A in input values and after check in rules I must be return error. In this sample how to check that?
<input id="starttime_range"
name="starttime_range"
type="text"
class="form-control"
/>
<input id="finish_range"
name="finish_range"
type="text"
class="form-control"
/>
starttime_range must be not equal with finish_range
My code :
public function postInsert()
{
$rules = array(
'starttime_range' => 'required|integer',
'endtime_range' => 'required|integer|not:starttime_range',
);
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
return Redirect::back()
->withErrors($validator)
->withInput();
} else {
}
}
endtime_rangecomes afterstarttime_range?