From 694634fbab14f4bddbfabf606209ef00934825d2 Mon Sep 17 00:00:00 2001 From: merdan Date: Sat, 7 May 2022 15:40:52 +0500 Subject: [PATCH] sarga filters --- config/broadcasting.php | 4 ++-- packages/Sarga/API/Http/Controllers/Brands.php | 2 +- packages/Sarga/API/Http/Controllers/Categories.php | 2 +- resources/assets/js/bootstrap.js | 11 +++++++++++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/config/broadcasting.php b/config/broadcasting.php index c8f718f32..5f16ae1a6 100755 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -37,8 +37,8 @@ return [ 'options' => [ 'cluster' => env('PUSHER_APP_CLUSTER'), 'encrypted' => true, - 'host' => env('PUSHER_HOST', 'sarga.com.tm'), - 'port' => env('PUSHER_PORT', 443), + 'host' => env('PUSHER_HOST', '127.0.0.1'), + 'port' => env('PUSHER_PORT', 4433), 'schema' => 'https', 'useTLS' => true, 'curl_options' => [ diff --git a/packages/Sarga/API/Http/Controllers/Brands.php b/packages/Sarga/API/Http/Controllers/Brands.php index 4615f166a..33c05a35c 100644 --- a/packages/Sarga/API/Http/Controllers/Brands.php +++ b/packages/Sarga/API/Http/Controllers/Brands.php @@ -60,7 +60,7 @@ class Brands extends \Webkul\RestApi\Http\Controllers\V1\Shop\ResourceController if ($sort = $request->input('sort')) { $query = $query->orderBy($sort, $request->input('order') ?? 'asc'); } else { - $query = $query->orderBy('id', 'asc'); + $query = $query->orderBy('position', 'desc')->orderBy('name', 'asc'); } return $query; diff --git a/packages/Sarga/API/Http/Controllers/Categories.php b/packages/Sarga/API/Http/Controllers/Categories.php index 94c1e43c0..a4bdbc696 100644 --- a/packages/Sarga/API/Http/Controllers/Categories.php +++ b/packages/Sarga/API/Http/Controllers/Categories.php @@ -33,7 +33,7 @@ class Categories extends CategoryController public function filters($id){ $category = $this->getRepositoryInstance()->with(['filterableAttributes','brands' => function ($q){ - $q->take(20)->orderBy('id', 'asc'); + $q->take(20)->orderBy('position', 'desc')->orderBy('name', 'asc'); } ]) ->find($id); diff --git a/resources/assets/js/bootstrap.js b/resources/assets/js/bootstrap.js index fb0f1eded..16e7bf6bb 100755 --- a/resources/assets/js/bootstrap.js +++ b/resources/assets/js/bootstrap.js @@ -1,3 +1,14 @@ +import Echo from 'laravel-echo'; +window.Pusher = require('pusher-js'); + +window.Echo = new Echo({ + broadcaster: 'pusher', + key: '1', + cluster: 'mt1', + wsHost: window.location.hostname, + wsPort: 6001, + wssPort: 443 +}); window._ = require('lodash'); window.Popper = require('popper.js').default;