1use Carbon\Carbon;
2
3// if today is January 22, 2021
4Carbon::now()->format('M'); // "Jan"
5Carbon::now()->format('m'); // "01"
6Carbon::now()->month; // 1
7
1public function myMonthApts()
2{
3 return $this->appointments()
4 ->whereIn('status_id', [3,4])
5 ->whereYear('created_at', Carbon::now()->year)
6 ->whereMonth('created_at', Carbon::now()->month)
7 ->count();
8}
9