return all dates in month laravel code example
Example 1: get current month record in laravel
User::whereMonth('created_at', date('m'))
->whereYear('created_at', date('Y'))
->get(['name','created_at']);
Example 2: fetch data based on month and year in laravel
$date = Carbon::createFromFormat('d/m/Y', $request->salary_date);
$empsalaries = EmpSalary:: whereMonth('salary_date', $date->month)
->whereYear('salary_date', $date->year)
->get()