Laravel Get Days In Month From Month Number?
PHP Snippet 1:
Carbon::now()->month($month_number)->daysInMonth;
// ...
Carbon::now()->month(02)->daysInMonth; // 28
PHP Snippet 2:
Carbon::createFromDate(null, $number_of_month, 1)->daysInMonth;
Carbon::now()->month($month_number)->daysInMonth;
// ...
Carbon::now()->month(02)->daysInMonth; // 28
Carbon::createFromDate(null, $number_of_month, 1)->daysInMonth;