feat(tenant): separate admin and storefront website types

This commit is contained in:
2026-09-17 14:25:46 -03:00
parent b9b5f8ec9c
commit 6bc784519f
31 changed files with 325 additions and 143 deletions

View File

@@ -42,7 +42,8 @@ use Illuminate\Support\Facades\Schema;
'favicon_id',
'header_bg_image_id',
'footer_bg_image_id',
'website_type_code',
'admin_website_type_code',
'storefront_website_type_code',
'search_product_layout',
'search_group_layout',
'search_items_per_page',
@@ -210,11 +211,17 @@ class Tenant extends Model
}
/**
* @return BelongsTo<WebsiteType, $this>
* @return BelongsTo<AdminWebsiteType, $this>
*/
public function websiteType(): BelongsTo
public function adminWebsiteType(): BelongsTo
{
return $this->belongsTo(WebsiteType::class, 'website_type_code', 'codigo');
return $this->belongsTo(AdminWebsiteType::class, 'admin_website_type_code', 'codigo');
}
/** @return BelongsTo<StorefrontWebsiteType, $this> */
public function storefrontWebsiteType(): BelongsTo
{
return $this->belongsTo(StorefrontWebsiteType::class, 'storefront_website_type_code', 'codigo');
}
public function catalogItems(): HasMany