feat(website): add website type and extras models with migration and tests

This commit is contained in:
2026-07-29 14:09:47 -03:00
parent 7c9ebc6d4d
commit 04bf03fc2e
6 changed files with 345 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
'footer_logo_id',
'hero_config',
'event_config',
'website_type_code',
'search_product_layout',
'search_group_layout',
'search_items_per_page',
@@ -89,6 +90,14 @@ class Tenant extends Model
return $this->belongsTo(Attachment::class, 'hero_bg_image_id');
}
/**
* @return BelongsTo<WebsiteType, $this>
*/
public function websiteType(): BelongsTo
{
return $this->belongsTo(WebsiteType::class, 'website_type_code', 'codigo');
}
/**
* @return BelongsToMany<Attachment, $this>
*/
@@ -136,6 +145,14 @@ class Tenant extends Model
->orderByPivot('orden');
}
/**
* @return HasMany<WebsiteExtra, $this>
*/
public function websiteExtras(): HasMany
{
return $this->hasMany(WebsiteExtra::class, 'website_code', 'codigo');
}
public function menues(): BelongsToMany
{
return $this->belongsToMany(