Level 5
May 5, 2020
1
Level 4
how to find data in previous date range in laravel
hellow I want to get the logic to find the previous data in date range
Example we fetch data from 2020-04-01 to 2020-05-02, so want to get the data from previous this range
anyone can help the logic from here
this query is just return the data of date range, but not previous
public function stock_by_period(Request $request){
$from = date('Y-m-d', strtotime($request->from);
$to = date('Y-m-d', strtotime($request->to)
$data=Loading::whereBetween('reservation_from', [$from, $to])->get();
dd($data);
}
Please or to participate in this conversation.