<?php

namespace App\Providers;

use App\Models\Document;
use App\Observers\DocumentObserver;
use Carbon\Carbon;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        //
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        // 配置 Carbon 使用中文
        Carbon::setLocale('zh_CN');

        // 注册文档观察者，用于自动管理 Meilisearch 索引
        Document::observe(DocumentObserver::class);
    }
}
