From 29870d81c68c217205f2863d02d059c935168ad9 Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Thu, 25 Nov 2021 13:41:29 +0700 Subject: [PATCH 1/7] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 305a86c..2cba683 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "illuminate/contracts": "~6.0|~7.0|~8.0", "illuminate/database": "~6.0|~7.0|~8.0", "illuminate/support": "~6.0|~7.0|~8.0", - "laravel/scout": "~7.0|~8.0" + "laravel/scout": "~7.0|~8.0|~9.0" }, "require-dev": { "phpunit/phpunit": "^8.3", From 468b7984f711dd76809ac64840ed4e4c76a6ed96 Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Thu, 25 Nov 2021 13:44:20 +0700 Subject: [PATCH 2/7] Update tests.yml --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3991ffa..673664b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,6 +5,7 @@ on: branches: - master pull_request: + workflow_dispatch: jobs: tests: @@ -49,4 +50,4 @@ jobs: composer update --prefer-dist --no-interaction --no-progress - name: Run tests - run: vendor/bin/phpunit --verbose \ No newline at end of file + run: vendor/bin/phpunit --verbose From 6655cc4df111f48a919431736fda7b9f50849a8d Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Fri, 26 Nov 2021 14:08:56 +0700 Subject: [PATCH 3/7] Update PostgresEngine.php --- src/PostgresEngine.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/PostgresEngine.php b/src/PostgresEngine.php index b92b3e0..004f7f0 100644 --- a/src/PostgresEngine.php +++ b/src/PostgresEngine.php @@ -561,4 +561,24 @@ public function flush($model) ->table($model->searchableAs()) ->update([$indexColumn => null]); } + + /** + * Map the given results to instances of the given model via a lazy collection. + * + * @param \Laravel\Scout\Builder $builder + * @param mixed $results + * @param \Illuminate\Database\Eloquent\Model $model + * @return \Illuminate\Support\LazyCollection + */ + public function lazyMap(Builder $builder, $results, $model) { + if ($this->getTotalCount($results) === 0) { + return LazyCollection::empty(); + } + + return LazyCollection::make($results->all()); + } + + public function createIndex($name, array $options = []) {} + + public function deleteIndex($name) {} } From fe7f4c2ad34a27205195a7b490c58cfea37fdcc4 Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Fri, 26 Nov 2021 14:10:07 +0700 Subject: [PATCH 4/7] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 673664b..13011d7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: matrix: php: [7.2, 7.3, 7.4] laravel: [^6.0, ^7.0, ^8.0] - scout: [^7.0, ^8.0] + scout: [^7.0, ^8.0, ^9.0] exclude: - php: 7.2 laravel: ^8.0 From 50c24ec01c31f75ef671b3af62180e2dc5e29e2e Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Fri, 26 Nov 2021 14:13:30 +0700 Subject: [PATCH 5/7] Update tests.yml --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 13011d7..84a254a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,6 +20,8 @@ jobs: exclude: - php: 7.2 laravel: ^8.0 + - laravel: ^6.0 + scout: ^9.0 - laravel: ^8.0 scout: ^7.0 include: From 8f3c162d3719653e0b8e9924fab28d89053a764e Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Fri, 26 Nov 2021 14:15:00 +0700 Subject: [PATCH 6/7] Update tests.yml --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 84a254a..8d8c1c8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,9 @@ jobs: - php: 7.2 laravel: ^8.0 - laravel: ^6.0 - scout: ^9.0 + scout: ^9.0 + - laravel: ^7.0 + scout: ^9.0 - laravel: ^8.0 scout: ^7.0 include: From 7b81b1cd2a8d05fe4ba471e6605476ab42c42fa7 Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Tue, 19 Apr 2022 16:41:17 +0700 Subject: [PATCH 7/7] Update composer.json --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 2cba683..fdf56d5 100644 --- a/composer.json +++ b/composer.json @@ -24,9 +24,9 @@ ], "require": { "php": "^7.2|^8.0", - "illuminate/contracts": "~6.0|~7.0|~8.0", - "illuminate/database": "~6.0|~7.0|~8.0", - "illuminate/support": "~6.0|~7.0|~8.0", + "illuminate/contracts": "~6.0|~7.0|~8.0|~9.0", + "illuminate/database": "~6.0|~7.0|~8.0|~9.0", + "illuminate/support": "~6.0|~7.0|~8.0|~9.0", "laravel/scout": "~7.0|~8.0|~9.0" }, "require-dev": {