app->environment('production')) { URL::forceScheme('https'); } // Domain-bewusster View Composer für user_shop \View::composer('*', function ($view) { try { $context = app(\App\Domain\DomainContext::class); // Für die Main-Domain: user_shop immer auf null setzen if ($context->type === 'main') { $view->with('user_shop', null); } else { // Für alle anderen Domains: normales Verhalten $userShop = $context->userShop ?? \App\Services\Util::getUserShop(); $view->with('user_shop', $userShop); } } catch (\Exception $e) { // Fallback bei Fehlern $view->with('user_shop', \App\Services\Util::getUserShop()); } }); } /** * Register any application services. * * @return void */ public function register() { if ($this->app->environment() !== 'production' && class_exists(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class)) { $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); } } }