Skip to content

Support laravel/scout 9.x #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
tests:
Expand All @@ -15,10 +16,14 @@ 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
- laravel: ^6.0
scout: ^9.0
- laravel: ^7.0
scout: ^9.0
- laravel: ^8.0
scout: ^7.0
include:
Expand Down Expand Up @@ -49,4 +54,4 @@ jobs:
composer update --prefer-dist --no-interaction --no-progress

- name: Run tests
run: vendor/bin/phpunit --verbose
run: vendor/bin/phpunit --verbose
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
],
"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"
"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",
Expand Down
20 changes: 20 additions & 0 deletions src/PostgresEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
}