feat(website-extras): add 'is_enabled' column to websites_extras table and update model and tests

This commit is contained in:
2026-07-31 09:38:30 -03:00
parent cbb7b1c3a1
commit 45e56c43a6
5 changed files with 73 additions and 5 deletions

View File

@@ -41,11 +41,13 @@ class TenantResource extends JsonResource
),
'extras' => $this->whenLoaded(
'websiteExtras',
fn () => $this->websiteExtras->mapWithKeys(fn ($extra) => [
$extra->websiteTypeExtra->codigo => $this->formatExtraConfig(
$extra->resolvedConfig()
),
])
fn () => $this->websiteExtras
->filter(fn ($extra) => $extra->is_enabled)
->mapWithKeys(fn ($extra) => [
$extra->websiteTypeExtra->codigo => $this->formatExtraConfig(
$extra->resolvedConfig()
),
])
),
// 1 day
'header_logo' => $this->headerLogo?->getTemporaryUrl(1440),