Level 122
have you checked the formats of $request->start and end ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a db table dateprices
id|tour_id|start|end|price
I want to get all the price of the tour starting between the dates i.e. 2017-06-21 and 2017-06-22
I have written following query but it is giving me all rows of the table:
public function datePrice(Request $request){
$start = $request->start;
$end = $request->end;
$dates = DatePrice::where('tour_id','=',$request->product_id)
->whereBetween('start', array($request->start, $request->end))
->get();
return response()->json($dates);
}
Please or to participate in this conversation.