From bcd656e364d37b17a663589201b4abdecc9470de Mon Sep 17 00:00:00 2001 From: rahul shukla Date: Wed, 9 Oct 2019 18:30:18 +0530 Subject: [PATCH] Issue #1563 --- .../src/Http/Controllers/CustomerController.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php b/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php index 6fee5f52d..b447a240c 100755 --- a/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php @@ -4,6 +4,7 @@ namespace Webkul\Customer\Http\Controllers; use Hash; use Webkul\Customer\Repositories\CustomerRepository; +use Webkul\Product\Repositories\ProductReviewRepository; /** * Customer controlller for the customer basically for the tasks of customers which will be @@ -28,19 +29,29 @@ class CustomerController extends Controller */ protected $customerRepository; + /** + * ProductReviewRepository object + * + * @var array + */ + protected $productReviewRepository; + /** * Create a new controller instance. * * @param \Webkul\Customer\Repositories\CustomerRepository $customer + * @param \Webkul\Product\Repositories\ProductReviewRepository $productReview * @return void */ - public function __construct(CustomerRepository $customerRepository) + public function __construct(CustomerRepository $customerRepository, ProductReviewRepository $productReviewRepository) { $this->middleware('customer'); $this->_config = request('_config'); $this->customerRepository = $customerRepository; + + $this->productReviewRepository = $productReviewRepository; } /** @@ -147,7 +158,7 @@ class CustomerController extends Controller */ public function reviews() { - $reviews = $this->productReview->getCustomerReview(); + $reviews = $this->productReviewRepository->getCustomerReview(); return view($this->_config['view'], compact('reviews')); }