This commit refactors the import statements in various controllers and jobs to improve code organization and readability. Unused imports were removed, and necessary imports were added to ensure proper functionality.
66 lines
1.9 KiB
PHP
66 lines
1.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Controllers\Fo\Pages;
|
|
|
|
use App\Contracts\Executor;
|
|
use App\Cqs\Queries\Products\GetPaginatedProductsQuery;
|
|
use App\Cqs\Queries\Products\GetPaginatedProductsQueryInput;
|
|
use App\Cqs\Queries\Ranges\GetPaginatedRangesQuery;
|
|
use App\Cqs\Queries\Ranges\GetPaginatedRangesQueryInput;
|
|
use App\Cqs\Queries\Slides\GetPaginatedSlidesQuery;
|
|
use App\Cqs\Queries\Slides\GetPaginatedSlidesQueryInput;
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Contracts\View\View;
|
|
use Infrastructure\Adapters\Services\AppCustomerAuthService;
|
|
use Shared\Pagination\Pagination;
|
|
|
|
class HomeController extends Controller
|
|
{
|
|
public function __construct(
|
|
private readonly AppCustomerAuthService $authService,
|
|
private readonly Executor $executor,
|
|
) {
|
|
}
|
|
|
|
public function index(
|
|
GetPaginatedProductsQuery $productsAction,
|
|
GetPaginatedSlidesQuery $slidesAction,
|
|
GetPaginatedRangesQuery $rangesAction
|
|
): View {
|
|
|
|
$starProductList = $this->executor->execute(
|
|
$productsAction,
|
|
new GetPaginatedProductsQueryInput(
|
|
Pagination::firstPage(),
|
|
starOnly: true,
|
|
publishedOnly: true,
|
|
withPricing: true,
|
|
)
|
|
)->items();
|
|
|
|
$slideList = $this->executor->execute(
|
|
$slidesAction,
|
|
new GetPaginatedSlidesQueryInput(
|
|
Pagination::firstPage(),
|
|
publishedOnly: true,
|
|
forConnectedCustomers: $this->authService->check()
|
|
)
|
|
)->items();
|
|
|
|
$rangeList = $this->executor->execute(
|
|
$rangesAction,
|
|
new GetPaginatedRangesQueryInput(
|
|
Pagination::firstPage(),
|
|
publishedOnly: true
|
|
)
|
|
)->items();
|
|
|
|
return view('fo.pages.home', compact(
|
|
'starProductList',
|
|
'slideList',
|
|
'rangeList'
|
|
));
|
|
}
|
|
}
|