Cart / Checkout / Payment Sayfalarının Çalışma Mantığı
Header + Footer
Tenant temasından gelir
Orta Kısım (Content)
Module default'tan gelir
Route: cart.index → CartPage::class (Livewire)
$theme = tenant()->theme
→
"ixtif"
$layoutPath = "themes.ixtif.layouts.app"
view('cart::livewire.front.cart-page')
Layout'taki {{ $slot }} yerine cart içeriği enjekte edilir
resources/views/themes/ ├── ixtif/ # İxtif Teması │ └── layouts/ │ ├── app.blade.php # Ana layout │ ├── header.blade.php # Header │ └── footer.blade.php # Footer │ ├── muzibu/ # Muzibu Teması │ └── layouts/ │ ├── app.blade.php # Ana layout │ ├── header.blade.php # Header │ └── footer.blade.php # Footer │ └── simple/ # Fallback Tema └── layouts/ ├── app.blade.php # Fallback layout ├── header.blade.php └── footer.blade.php Modules/ ├── Cart/ │ └── resources/views/livewire/front/ │ ├── cart-page.blade.php # ← TÜM TENANT'LAR KULLANIR │ └── checkout-page.blade.php # ← TÜM TENANT'LAR KULLANIR │ └── Payment/ └── resources/views/livewire/front/ └── payment-page.blade.php # ← TÜM TENANT'LAR KULLANIR
public function render()
{
// 1. Tenant temasını al (accessor: theme_id → folder_name)
$theme = tenant()->theme ?? 'simple';
// 2. Layout path'i oluştur
$layoutPath = "themes.{$theme}.layouts.app";
// 3. Layout yoksa simple'a fallback
if (!view()->exists($layoutPath)) {
$layoutPath = 'themes.simple.layouts.app';
}
// 4. View her zaman module default
return view('cart::livewire.front.cart-page')
->layout($layoutPath);
}