How to add months in your Date and DateTime in Laravel using carbon
UserController.php :
public function addMonths()
{
$current_time = Carbon::now();
$after_month_added = $current_time->addMonths(6);
//converting the date time to readable form
$readable_date = $after_month_added->toDateTimeString();
return $readable_date;
}
Output :
Thank you for reading this article 😊
For any query do not hesitate to comment 💬
