From 3df70c51f7a3aa4c17aeeb5aadd97309dbf0ac72 Mon Sep 17 00:00:00 2001 From: Phil Bates Date: Wed, 24 Jan 2024 17:32:37 +0000 Subject: [PATCH] Use CarbonImmutable by default Because immutable generally results in less bugs. --- app/Providers/AppServiceProvider.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 374d0cc..b0b3b8a 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -4,7 +4,9 @@ namespace App\Providers; +use Carbon\CarbonImmutable; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Facades\Date; use Illuminate\Support\Facades\Log; use Illuminate\Support\ServiceProvider; use Illuminate\Translation\Translator; @@ -39,6 +41,8 @@ public function register(): void */ public function boot(): void { + Date::useClass(CarbonImmutable::class); + if ($this->isProduction()) { Model::shouldBeStrict(); }