* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ class WishlistController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ protected $_config; protected $customer; public function __construct(CustomerRepository $customer) { $this->middleware('customer'); $this->_config = request('_config'); $this->customer = $customer; } /** * For taking the customer * to the dashboard after * authentication * @return view */ private function getCustomer($id) { $customer = collect($this->customer->findOneWhere(['id'=>$id])); return $customer; } public function index() { $id = auth()->guard('customer')->user()->id; $customer = $this->getCustomer($id); return view($this->_config['view'])->with('customer', $customer); } /** * Function to add item to the wishlist. * * @param integer $itemId */ public function add() { dd('adding item to wishlist'); } /** * Function to remove item to the wishlist. * * @param integer $itemId */ public function remove($itemId) { dd('removing item to wishlist'); } /** * Function to move item from wishlist to cart. * * @param integer $itemId */ public function moveToCart() { dd('adding item to wishlist'); } }