feat(tenant): add main carousel images functionality with migration, model, and tests

This commit is contained in:
2026-07-23 14:19:00 -03:00
parent e778d862ba
commit 67ede1a2b4
9 changed files with 241 additions and 12 deletions

View File

@@ -2,11 +2,12 @@
namespace App\Domains\Tenant\Resources;
use App\Domains\Tenant\Models\Tenant;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
/**
* @mixin \App\Domains\Tenant\Models\Tenant
* @mixin Tenant
*/
class TenantResource extends JsonResource
{
@@ -34,9 +35,15 @@ class TenantResource extends JsonResource
'footer_bg_color' => $this->footer_bg_color,
// 1 day
'header_logo' => $this->headerLogo?->getTemporaryUrl(1440),
'footer_logo' => $this->footerLogo?->getTemporaryUrl(1440 ),
'footer_logo' => $this->footerLogo?->getTemporaryUrl(1440),
'hero_config' => $heroConfig,
'event_config' => $this->event_config,
'main_carousel_images' => $this->whenLoaded(
'mainCarouselImages',
fn () => $this->mainCarouselImages
->map(fn ($attachment) => $attachment->getTemporaryUrl(1440))
->values()
),
'menues' => $this->whenLoaded('menues'),
];
}