commit 08-2025
This commit is contained in:
parent
9ae662f63e
commit
480fdc65ed
404 changed files with 65310 additions and 2600431 deletions
|
|
@ -4,6 +4,7 @@ namespace App\Providers;
|
|||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -15,6 +16,29 @@ class AppServiceProvider extends ServiceProvider
|
|||
public function boot()
|
||||
{
|
||||
Schema::defaultStringLength(191);
|
||||
|
||||
if ($this->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());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue