mergeConfigFrom(__DIR__ . '/../../config/school_context.php', 'school_context'); $this->app->singleton(SchoolContextStore::class); $this->app->bind(SchoolContextFactory::class); $this->app->bind(SchoolContextResolver::class); $this->app->bind(SchoolContextValidator::class); } public function boot(Kernel $kernel): void { $this->publishes([ __DIR__ . '/../../config/school_context.php' => config_path('school_context.php'), ], 'school-context-config'); // Laravel 10/older: also register alias in app/Http/Kernel.php if preferred. app('router')->aliasMiddleware('school.context', ResolveSchoolContext::class); } }