diff --git a/composer.json b/composer.json index bb079a481..72660d9d9 100755 --- a/composer.json +++ b/composer.json @@ -18,21 +18,22 @@ "ext-pdo_mysql": "*", "ext-tokenizer": "*", "astrotomic/laravel-translatable": "^11.0.0", - "barryvdh/laravel-dompdf": "0.8.4", + "barryvdh/laravel-dompdf": "0.8.5", "doctrine/dbal": "2.9.2", "fideloper/proxy": "^4.0", "flynsarmy/db-blade-compiler": "*", "guzzlehttp/guzzle": "~6.0", "intervention/image": "^2.4", "intervention/imagecache": "^2.3", - "kalnoy/nestedset": "^4.3", + "kalnoy/nestedset": "5.0.0", "konekt/concord": "^1.2", - "laravel/framework": "5.8.*", + "laravel/framework": "^6.0", + "laravel/helpers": "^1.1", "laravel/tinker": "^1.0", - "maatwebsite/excel": "3.1.11", + "maatwebsite/excel": "3.1.18", "nwidart/laravel-modules": "^3.2", - "prettus/l5-repository": "2.6.32", - "tymon/jwt-auth": "1.0.0-rc.4" + "prettus/l5-repository": "^2.6", + "tymon/jwt-auth": "^1.0.0" }, "require-dev": { @@ -40,7 +41,7 @@ "barryvdh/laravel-debugbar": "^3.1", "filp/whoops": "^2.0", "fzaninotto/faker": "^1.4", - "laravel/dusk": "^4.0", + "laravel/dusk": "^5.7.0", "mockery/mockery": "^1.0", "nunomaduro/collision": "^2.0", "phpunit/phpunit": "^7.0" diff --git a/packages/Webkul/Core/src/Eloquent/Repository.php b/packages/Webkul/Core/src/Eloquent/Repository.php index b5ef37809..f274b2d62 100755 --- a/packages/Webkul/Core/src/Eloquent/Repository.php +++ b/packages/Webkul/Core/src/Eloquent/Repository.php @@ -82,18 +82,28 @@ abstract class Repository extends BaseRepository { return $this->parserResult($model); } - /** - * @return mixed + /** + * Count results of repository + * + * @param array $where + * @param string $columns + * + * @return int */ - public function count() + public function count(array $where = [], $columns = '*') { $this->applyCriteria(); $this->applyScope(); - $total = $this->model->count(); - $this->resetModel(); + if ($where) { + $this->applyConditions($where); + } - return $total; + $result = $this->model->count($columns); + $this->resetModel(); + $this->resetScope(); + + return $result; } /** diff --git a/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php b/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php index 5fc59c6d9..91d6584e5 100755 --- a/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php @@ -170,7 +170,7 @@ class WishlistController extends Controller } catch (\Exception $e) { session()->flash('warning', $e->getMessage()); - return redirect()->route('shop.productOrCategory.index', ['slug' => $wishlistItem->product->url_key]); + return redirect()->route('shop.productOrCategory.index', ['slugOrPath' => $wishlistItem->product->url_key]); } } diff --git a/packages/Webkul/Shop/src/Http/Controllers/CartController.php b/packages/Webkul/Shop/src/Http/Controllers/CartController.php index b23c42b4c..190ce7583 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/CartController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/CartController.php @@ -61,7 +61,7 @@ class CartController extends Controller /** * Method to populate the cart page which will be populated before the checkout process. * - * @return \Illuminate\View\View + * @return \Illuminate\View\View */ public function index() { @@ -96,7 +96,7 @@ class CartController extends Controller $product = $this->productRepository->find($id); - return redirect()->route('shop.productOrCategory.index', ['slug' => $product->url_key]); + return redirect()->route('shop.productOrCategory.index', ['slugOrPath' => $product->url_key]); } return redirect()->back(); diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/index.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/index.blade.php index 0e24927d6..46252cb70 100755 --- a/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/index.blade.php @@ -35,15 +35,14 @@