Skip to content

Instantly share code, notes, and snippets.

@introqt
Created July 29, 2020 09:12
Show Gist options
  • Save introqt/8acba4035abbd45de0534326d8d2f7b1 to your computer and use it in GitHub Desktop.
Save introqt/8acba4035abbd45de0534326d8d2f7b1 to your computer and use it in GitHub Desktop.

Revisions

  1. introqt renamed this gist Jul 29, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. introqt created this gist Jul 29, 2020.
    46 changes: 46 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,46 @@
    <?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(),
    ]);
    }
    }