Created
July 29, 2020 09:12
-
-
Save introqt/8acba4035abbd45de0534326d8d2f7b1 to your computer and use it in GitHub Desktop.
HomeController.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); | |
| namespace Modules\Home\Http\Controllers\Front; | |
| use Illuminate\Routing\Controller; | |
| use Modules\Home\Services\HomePageInterface; | |
| /** | |
| * Class HomeController | |
| * | |
| * @package Modules\Home\Http\Controllers\Front | |
| */ | |
| class HomeController extends Controller | |
| { | |
| /** | |
| * @var HomePageInterface | |
| */ | |
| private $home_page_service; | |
| /** | |
| * HomeController constructor. | |
| * @param HomePageInterface $home_page_service | |
| */ | |
| public function __construct(HomePageInterface $home_page_service) | |
| { | |
| $this->home_page_service = $home_page_service; | |
| } | |
| /** | |
| * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | |
| * @throws \Illuminate\Contracts\Container\BindingResolutionException | |
| */ | |
| public function index() | |
| { | |
| return view('home::front.index', [ | |
| 'page' => $this->home_page_service->getPage(), | |
| 'seasonal_offers' => $this->home_page_service->getSeasonalOffers(), | |
| 'articles_on_main' => $this->home_page_service->getArticles(), | |
| 'product_categories' => $this->home_page_service->getProductCategories(), | |
| 'sliders' => $this->home_page_service->getSliders(), | |
| ]); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment