There are many ways to do that. Since you are using Laravel, you can easily use ->endOfMonth() of Carbon for that.
For example
now()->endOfMonth()
It will return you the last day of the current month.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I want to get the last day of a month in laravel. How can I get it?
There are many ways to do that. Since you are using Laravel, you can easily use ->endOfMonth() of Carbon for that.
For example
now()->endOfMonth()
It will return you the last day of the current month.
Please or to participate in this conversation.