From 08531b1ad43c8ae1fc233210401b92a86382bbcb Mon Sep 17 00:00:00 2001 From: Peter Matseykanets Date: Tue, 18 Jan 2022 11:58:24 -0500 Subject: [PATCH 1/8] [WIP] Support Scout 9 and Laravel 9 --- .github/workflows/tests.yml | 17 ++++++----------- composer.json | 10 +++++----- src/PostgresEngine.php | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3991ffa..fcaa17b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,18 +13,13 @@ jobs: strategy: fail-fast: true matrix: - php: [7.2, 7.3, 7.4] - laravel: [^6.0, ^7.0, ^8.0] - scout: [^7.0, ^8.0] + php: [7.3, 7.4, 8.0] + laravel: [^6.0, ^7.0, ^8.0, ^9.0] + scout: [^7.0, ^8.0, ^9.0] exclude: - - php: 7.2 - laravel: ^8.0 - - laravel: ^8.0 - scout: ^7.0 - include: - - php: 8.0 - laravel: ^8.0 - scout: ^8.0 + - scout: ^7.0 + - laravel: [^8.0, ^9.0] + name: Test PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - Scout ${{ matrix.scout }} diff --git a/composer.json b/composer.json index 305a86c..0c51981 100644 --- a/composer.json +++ b/composer.json @@ -23,11 +23,11 @@ } ], "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", - "laravel/scout": "~7.0|~8.0" + "php": "^7.3|^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": { "phpunit/phpunit": "^8.3", diff --git a/src/PostgresEngine.php b/src/PostgresEngine.php index b92b3e0..8ee4770 100644 --- a/src/PostgresEngine.php +++ b/src/PostgresEngine.php @@ -339,6 +339,42 @@ public function map(Builder $builder, $results, $model) }); } + /** + * 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) + { + // TBD + } + + /** + * Create a search index. + * + * @param string $name + * @param array $options + * @return mixed + */ + public function createIndex($name, array $options = []) + { + // TBD. + } + + /** + * Delete a search index. + * + * @param string $name + * @return mixed + */ + public function deleteIndex($name) + { + // TBD. + } + /** * Connect to the database. */ From b4256eb335a45081afaa421e5ba8b94cc50f12c6 Mon Sep 17 00:00:00 2001 From: Peter Matseykanets Date: Tue, 18 Jan 2022 12:10:30 -0500 Subject: [PATCH 2/8] build: Work on matrix excludes --- .github/workflows/tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fcaa17b..32341e6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,9 +17,10 @@ jobs: laravel: [^6.0, ^7.0, ^8.0, ^9.0] scout: [^7.0, ^8.0, ^9.0] exclude: - - scout: ^7.0 - - laravel: [^8.0, ^9.0] - + - laravel: ^8.0 + scout: ^7.0 + - laravel: ^9.0 + scout: ^7.0 name: Test PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - Scout ${{ matrix.scout }} From 78a815653ed1c72bcd9555a220ce609761e816d9 Mon Sep 17 00:00:00 2001 From: Peter Matseykanets Date: Tue, 18 Jan 2022 12:16:47 -0500 Subject: [PATCH 3/8] build: Work on matrix excludes 2 --- .github/workflows/tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 32341e6..2c775eb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,10 +17,14 @@ jobs: laravel: [^6.0, ^7.0, ^8.0, ^9.0] scout: [^7.0, ^8.0, ^9.0] exclude: + - laravel: ^6.0 + scout: [^8.0, ^9.0] + - laravel: ^7.0 + scout: ^9.0 - laravel: ^8.0 scout: ^7.0 - laravel: ^9.0 - scout: ^7.0 + scout: [^7.0, ^8.0] name: Test PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - Scout ${{ matrix.scout }} From b3f84ef5a4be512d6137b8cca5e77480b6f278c5 Mon Sep 17 00:00:00 2001 From: Peter Matseykanets Date: Tue, 18 Jan 2022 12:18:30 -0500 Subject: [PATCH 4/8] build: Work on matrix excludes 3 --- .github/workflows/tests.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2c775eb..66c774c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,13 +18,17 @@ jobs: scout: [^7.0, ^8.0, ^9.0] exclude: - laravel: ^6.0 - scout: [^8.0, ^9.0] + scout: ^8.0 + - laravel: ^6.0 + scout: ^9.0 - laravel: ^7.0 scout: ^9.0 - laravel: ^8.0 scout: ^7.0 - laravel: ^9.0 - scout: [^7.0, ^8.0] + scout: ^7.0 + - laravel: ^9.0 + scout: ^8.0 name: Test PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - Scout ${{ matrix.scout }} From 965b0afef986347090e053fb1616dc50a7b4b80a Mon Sep 17 00:00:00 2001 From: Peter Matseykanets Date: Tue, 18 Jan 2022 12:23:13 -0500 Subject: [PATCH 5/8] build: Work on matrix excludes 4 --- .github/workflows/tests.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 66c774c..623566c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,6 +17,14 @@ jobs: laravel: [^6.0, ^7.0, ^8.0, ^9.0] scout: [^7.0, ^8.0, ^9.0] exclude: + - php: ^7.0 + laravel: ^8.0 + scout: ^8.0 + - php: ^7.0 + laravel: ^9.0 + scout: ^9.0 + - php: ^8.0 + laravel: ^6.0 - laravel: ^6.0 scout: ^8.0 - laravel: ^6.0 From 6c119b3f25710b4f02a0719972f9adfb50d17e21 Mon Sep 17 00:00:00 2001 From: Peter Matseykanets Date: Tue, 18 Jan 2022 12:27:16 -0500 Subject: [PATCH 6/8] build: Work on matrix excludes 5 --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 623566c..b3d8c14 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,17 +17,17 @@ jobs: laravel: [^6.0, ^7.0, ^8.0, ^9.0] scout: [^7.0, ^8.0, ^9.0] exclude: - - php: ^7.0 + - php: 7.3 laravel: ^8.0 scout: ^8.0 - - php: ^7.0 + - php: 7.3 laravel: ^9.0 scout: ^9.0 - - php: ^8.0 - laravel: ^6.0 - laravel: ^6.0 + php: 8.0 scout: ^8.0 - laravel: ^6.0 + php: 8.0 scout: ^9.0 - laravel: ^7.0 scout: ^9.0 From eeee632a2d4299c4743f73e28e906da0dca2d94b Mon Sep 17 00:00:00 2001 From: Peter Matseykanets Date: Tue, 18 Jan 2022 12:32:43 -0500 Subject: [PATCH 7/8] build: Work on matrix excludes 6 --- .github/workflows/tests.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b3d8c14..6dc3274 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,15 +19,17 @@ jobs: exclude: - php: 7.3 laravel: ^8.0 - scout: ^8.0 - php: 7.3 + scout: ^8.0 + - php: 7.4 laravel: ^9.0 + - php: 7.4 scout: ^9.0 + - php: 8.0 + laravel: ^6.0 - laravel: ^6.0 - php: 8.0 scout: ^8.0 - laravel: ^6.0 - php: 8.0 scout: ^9.0 - laravel: ^7.0 scout: ^9.0 From 829476b2e370a3227fc288818593e25175377fda Mon Sep 17 00:00:00 2001 From: Peter Matseykanets Date: Tue, 18 Jan 2022 12:44:03 -0500 Subject: [PATCH 8/8] build: Work on matrix excludes 7 --- .github/workflows/tests.yml | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6dc3274..4cd1216 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,32 +13,16 @@ jobs: strategy: fail-fast: true matrix: - php: [7.3, 7.4, 8.0] - laravel: [^6.0, ^7.0, ^8.0, ^9.0] - scout: [^7.0, ^8.0, ^9.0] - exclude: - - php: 7.3 - laravel: ^8.0 - - php: 7.3 - scout: ^8.0 + php: [8.0, 8.1] + laravel: [^7.0, ^8.0, ^9.0] + scout: [^8.0, ^9.0] + include: - php: 7.4 - laravel: ^9.0 - - php: 7.4 - scout: ^9.0 - - php: 8.0 laravel: ^6.0 - - laravel: ^6.0 - scout: ^8.0 - - laravel: ^6.0 - scout: ^9.0 - - laravel: ^7.0 - scout: ^9.0 - - laravel: ^8.0 scout: ^7.0 - - laravel: ^9.0 + - php: 7.4 + laravel: ^7.0 scout: ^7.0 - - laravel: ^9.0 - scout: ^8.0 name: Test PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - Scout ${{ matrix.scout }}