app->singleton(Schema::class); $this->app->singleton(SchemaBuilderService::class); $this->app->singleton(ServiceOgImageService::class); // Register validators $this->app->singleton(OgImageValidator::class); $this->app->singleton(CanonicalUrlValidator::class); $this->app->singleton(StructuredDataTester::class); // Register analytics services $this->app->singleton(SeoScoreTrend::class); // Register backward compatibility aliases $this->registerBackwardCompatAliases(); } /** * Bootstrap services. */ public function boot(): void { $this->registerCommands(); } /** * Register console commands. */ protected function registerCommands(): void { if ($this->app->runningInConsole()) { $this->commands([ AuditCanonicalUrls::class, RecordSeoScores::class, TestStructuredData::class, ]); } } /** * Register backward compatibility class aliases. * * These allow existing code using old namespaces to continue working * while we migrate to the new Core structure. */ protected function registerBackwardCompatAliases(): void { // Schema (high-level JSON-LD generator) if (! class_exists(SchemaService::class)) { class_alias(Schema::class, SchemaService::class); } // Services if (! class_exists(\App\Services\SchemaBuilderService::class)) { class_alias(SchemaBuilderService::class, \App\Services\SchemaBuilderService::class); } if (! class_exists(\App\Services\ServiceOgImageService::class)) { class_alias(ServiceOgImageService::class, \App\Services\ServiceOgImageService::class); } } }