* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ class SliderController extends controller { protected $_config; protected $slider; protected $channels; public function __construct(Slider $slider) { $this->slider = $slider; $this->_config = request('_config'); } /** * Loads the index * for the sliders * settings. */ public function index() { return view($this->_config['view']); } /** * Loads the form * for creating * slider. */ public function create() { $call = new Channel(); $channels = $call->getAllChannels(); return view($this->_config['view'])->with('channels',[$channels]); } /** * Creates the new * sider item */ public function store() { $this->slider->create(request()->all()); session()->flash('success', 'Slider created successfully.'); return redirect()->back(); } }