get data according to month with query in 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
$post = Mjblog::whereYear('created_at', '=', $year)
->whereMonth('created_at', '=', $month)
->get();