I build a search form which will select markers from database where date is inserted in datapicker. That works fine but , when I add time I get error .
I rebuilded a query to something like that :
$datefrom = $request->input('datefrom');
$dateto = $request->input('dateto');
$timefrom = $request->input('timefrom');
$timfrom = $timefrom.':00';
$timeto = $request -> input('timeto');
$timto = $timeto.':00';
$type = $request->input('type');
$maps = Map::select('lat','lng',$type,'temp','humidity','date','time')
->where(function($query){
$query->whereBetween('date',array($datefrom,$dateto))
->whereBetween('time',array($timfrom,$timto));
})
->get();
When I enter check on search form I get error :
Undefined variable : $datefrom etc.
Any help ?