42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Application\Queries\Marketing;
|
|
|
|
use App\Application\Data\HomeContent;
|
|
use App\Models\PortfolioCase;
|
|
use App\Models\Service;
|
|
use App\Models\SiteSetting;
|
|
use App\Models\Testimonial;
|
|
use App\Models\WeddingPackage;
|
|
|
|
final class GetHomeContent
|
|
{
|
|
public function __invoke(): HomeContent
|
|
{
|
|
return new HomeContent(
|
|
settings: SiteSetting::instance(),
|
|
featuredServices: Service::query()
|
|
->published()
|
|
->where('is_featured', true)
|
|
->orderBy('sort_order')
|
|
->get(),
|
|
featuredCases: PortfolioCase::query()
|
|
->published()
|
|
->where('is_featured', true)
|
|
->with(['images'])
|
|
->orderBy('sort_order')
|
|
->get(),
|
|
testimonials: Testimonial::query()
|
|
->published()
|
|
->orderBy('sort_order')
|
|
->get(),
|
|
packages: WeddingPackage::query()
|
|
->published()
|
|
->orderBy('sort_order')
|
|
->get(),
|
|
);
|
|
}
|
|
}
|