@prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ class HomeController extends Controller { protected $_config; protected $sliderRepository; protected $current_channel; public function __construct(SliderRepository $sliderRepository) { $this->_config = request('_config'); $this->sliderRepository = $sliderRepository; } /** * loads the home page for the storefront */ public function index() { if (request()->route('any')) abort(404); $currentChannel = core()->getCurrentChannel(); $sliderData = $this->sliderRepository->findWhere(['channel_id' => $currentChannel->id])->toArray(); return view($this->_config['view'], compact('sliderData')); } }