app->singleton(\App\Services\MathRecSysService::class, function () { return new \App\Services\MathRecSysService(); }); // 注册知识图谱服务 $this->app->singleton(\App\Services\KnowledgeGraphService::class, function ($app) { return new \App\Services\KnowledgeGraphService( $app->make(\App\Services\MathRecSysService::class) ); }); } /** * Bootstrap any application services. */ public function boot(): void { if (config('app.env') === 'production') { URL::forceScheme('https'); } } }