Created
March 6, 2019 09:59
-
-
Save jakewtaylor/23b61f2026bcde75abed618f7adcf169 to your computer and use it in GitHub Desktop.
How to use CarbonImmutable Laravel 5.8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
// The Date facade | |
use Illuminate\Support\Facades\Date; | |
// And the CarbonImmutable class | |
use Carbon\CarbonImmutable; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
public function register() | |
{ | |
Date::use(CarbonImmutable::class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment