andrewdwallo / erpsaas

A Laravel and Filament-powered accounting platform, crafting a modern and automated solution for financial management.
MIT License
856 stars 241 forks source link

Error while updating Fiscal Year End Localization settings #75

Closed amangoswami679 closed 4 weeks ago

amangoswami679 commented 4 weeks ago

Hello I was running this system locally, and while updating the fiscal year end localisation, I ran into an exception. This is actually caused by Carbon version upgrade. Referenced Issue

When trying to execute $daysInMonth = now()->month($month)->daysInMonth; to get the days of the selected month, Carbon's Date trait's setUnit method is being called.

Prior to Carbon 3.0.0:

public function setUnit($unit, $value = null)
{
    // Code
}

In Carbon 3.0.0:

public function setUnit(string $unit, Month|int|float|null $value = null): static
{
    // Code
}

As the value being passed is a string, a TypeError is thrown.

andrewdwallo commented 4 weeks ago

Issue has been fixed. Update your fork and let me know if you have any more issues. Thanks.