<?php

namespace Kylin\Logistics;

use Illuminate\Support\ServiceProvider;

/**
 * 物流管理服务提供者
 *
 * 提供运单管理、车辆调度、GPS 追踪等物流核心功能。
 */
class LogisticsServiceProvider extends ServiceProvider
{
    public function register(): void
    {
        $this->mergeConfigFrom(
            __DIR__ . '/../config/kylin-logistics.php',
            'kylin-logistics'
        );
    }

    public function boot(): void
    {
        if ($this->app->runningInConsole()) {
            $this->publishes([
                __DIR__ . '/../config/kylin-logistics.php' => config_path('kylin-logistics.php'),
            ], 'kylin-logistics-config');

            $this->publishes([
                __DIR__ . '/../database/migrations' => database_path('migrations'),
            ], 'kylin-logistics-migrations');
        }

        $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');
    }
}
