2018-07-12 07:12:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Webkul\Shop\Http\Controllers;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
use Illuminate\Http\Response;
|
|
|
|
|
use Illuminate\Routing\Controller;
|
2018-08-09 12:00:26 +00:00
|
|
|
use Webkul\Core\Repositories\SliderRepository as Sliders;
|
|
|
|
|
use Webkul\Channel\Channel as Channel;
|
2018-07-12 07:12:48 +00:00
|
|
|
/**
|
|
|
|
|
* Admin user session controller
|
|
|
|
|
*
|
|
|
|
|
* @author Jitendra Singh <jitendra@webkul.com>
|
|
|
|
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
|
|
|
|
*/
|
|
|
|
|
class HomeController extends controller
|
|
|
|
|
{
|
|
|
|
|
protected $_config;
|
2018-08-09 12:00:26 +00:00
|
|
|
protected $sliders;
|
|
|
|
|
protected $current_channel;
|
2018-07-12 07:12:48 +00:00
|
|
|
|
2018-08-09 12:00:26 +00:00
|
|
|
public function __construct(Sliders $s,Channel $c)
|
2018-07-12 07:12:48 +00:00
|
|
|
{
|
|
|
|
|
$this->_config = request('_config');
|
2018-08-09 12:00:26 +00:00
|
|
|
$this->sliders = $s;
|
|
|
|
|
$this->current_channel = $c;
|
2018-07-12 07:12:48 +00:00
|
|
|
|
|
|
|
|
}
|
2018-08-09 12:00:26 +00:00
|
|
|
public function index() {
|
|
|
|
|
|
|
|
|
|
$current_channel = $this->current_channel->getCurrentChannel();
|
|
|
|
|
|
|
|
|
|
$all_sliders = $this->sliders->findWhere(['channel_id'=>$current_channel['id']]);
|
|
|
|
|
|
|
|
|
|
return view($this->_config['view'])->with('data',$all_sliders);
|
2018-07-12 07:12:48 +00:00
|
|
|
}
|
|
|
|
|
}
|