Level 1
What is the request returning.? in which format of month?
Note, the start_day format must be same as the year.
so if you have start_day as 2019 in your db, then your $request->year must be of type year as 2019. same as the months.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm trying to query by the month and year but it's returning an empty array for each month. Here's my function
public function month($id, Request $request){
$user = auth()->user();
$month = $request->month;
$year = $request->year;
dd($times = Time::where('user_id', $id)
->whereYear('start_day', $request->year)
->whereMonth('start_day', $request->month)
->get());
return view ('admin.report.month', compact('month', 'year', 'user'));
}
All my requests are working properly.
Please or to participate in this conversation.