无法验证变量。使用此显示错误未定义的偏移量:2。我只想验证垂直字段,以便必须同时输入两个条目才能获取过滤器数据。
public function TimesheetResult(Request $request){
$datefrom= $request->input('datefrom');
$dateto= $request->input('dateto');
$orderfrom = explode('/',$datefrom);
$orderto = explode('/', $dateto);
$fromdate = $orderfrom[2]. "-" .$orderfrom[1]. "-" .$orderfrom[0];
$todate = $orderto[2]. "-" .$orderto[1]. "-" .$orderto[0];
$values = UserTimesheet::getDataBetweenDates($fromdate, $todate);
$validator = Validator::make($values, [
'fromdate' => 'required|date',
'todate' => 'required|date',
]);
return view('admin.timesheet-result',compact('values'));
// print_r($value); exit;
}