laravel-websockets
laravel-websockets copied to clipboard
fix: Account for CarbonImmutable used in Laravel projects in CleanStatistics command
Laravel projects can easily be globally configured to use CarbonImmutable objects instead of normal mutable ones.
Projects like this cause an exception when running CleanStatistics
command:
BeyondCode\LaravelWebSockets\Statistics\Stores\DatabaseStore::delete():
Argument #1 ($moment) must be of type Carbon\Carbon, Carbon\CarbonImmutable given, called in
/home/app/michman/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 337
Proper fix would be to declare Carbon instances in StatisticsStore
interface as CarbonInterface
, but this would break the existing stores, so this PR suggests a slightly dirty fix to this issue.