* * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace App\Providers; use Carbon\Carbon; use Illuminate\Support\Facades\App; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Register any application services. */ public function register() { } /** * Bootstrap any application services. * * @return void */ public function boot() { if (App::getLocale() == 'zh_CN') { Carbon::setLocale('zh'); } $this->registerObservers(); // 注册观察者 } protected function registerObservers(): void { } }