We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
By default, Laravel uses
Carbon
for dates, but the object returned by the\Illuminate\Support\Facades\Date
helper is mutable.To configure Laravel to use
CarbonImmutable
instead, call this method in yourAppServiceProvider
'sboot()
method:use Carbon\CarbonImmutable; use Illuminate\Support\Facades\Date; class AppServiceProvider extends ServiceProvider { public function boot() { Date::use(CarbonImmutable::class); } }
Just make sure to use Laravel's
Date
facade instead ofCarbon
directly in your application code.
continue reading on rias.be
⚠️ This post links to an external website. ⚠️
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.