Skip to content

Commit

Permalink
feat: Laravel 10 support (#320)
Browse files Browse the repository at this point in the history
* feat: add support for Laravel 10

* fix: remove support for PHP 8.0

* fix: force yes when adding repo

* chore: update testbench dependency

* Update composer.json

* Update phpstan.neon.dist

* chore: drop Laravel 8 support

* chore: change dispatch function call

* chore: drop PHP 7.x support
  • Loading branch information
DevinCodes authored Feb 6, 2023
1 parent e097188 commit d27ffec
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
steps:
- checkout

- run: sudo add-apt-repository ppa:ondrej/php
- run: sudo add-apt-repository ppa:ondrej/php -y
- run: sudo apt-get update
- run: sudo apt-get install -y php<<parameters.version>>-zip php<<parameters.version>>-sqlite3
- restore_cache: *restore_cache
Expand All @@ -85,10 +85,10 @@ workflows:
- test:
matrix:
parameters:
version: ['7.3', '7.4', '8.0', '8.1']
laravel: ['^8.0']
version: ['8.0', '8.1', '8.2']
laravel: ['^9.0']
- test:
matrix:
parameters:
version: ['8.0', '8.1']
laravel: ['^9.0']
version: ['8.1', '8.2']
laravel: ['^10.0']
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
],
"require": {
"php": "^7.3|^8.0",
"php": "^8.0",
"ext-json": "*",
"algolia/algoliasearch-client-php": "^3.0.0",
"illuminate/console": "^8.0|^9.0",
"illuminate/contracts": "^8.0|^9.0",
"illuminate/database": "^8.0|^9.0",
"illuminate/filesystem": "^8.0|^9.0",
"illuminate/support": "^8.0|^9.0",
"laravel/scout": "^8.0|^9.0",
"illuminate/console": "^9.0|^10.0",
"illuminate/contracts": "^9.0|^10.0",
"illuminate/database": "^9.0|^10.0",
"illuminate/filesystem": "^9.0|^10.0",
"illuminate/support": "^9.0|^10.0",
"laravel/scout": "^9.0|^10.0",
"riimu/kit-phpencoder": "^2.4"
},
"suggest": {
Expand All @@ -31,8 +31,8 @@
"require-dev": {
"fakerphp/faker": "^1.13",
"mockery/mockery": "^1.4",
"nunomaduro/larastan": "^1.0",
"orchestra/testbench": "^4.9|^5.9|^6.6|^7.0",
"nunomaduro/larastan": "^1.0|^2.0",
"orchestra/testbench": "^4.9|^5.9|^6.6|^7.0|^8.0",
"phpstan/phpstan": "^1.3",
"phpunit/phpunit": "^8.0|^9.0",
"laravel/legacy-factories": "^1.1"
Expand Down
2 changes: 0 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ parameters:
- '#Illuminate\\Database\\Eloquent\\Model::searchableAs\(\)#'
- '#Algolia\\ScoutExtended\\ScoutExtendedServiceProvider::getModel\(\)#'
- '#Unsafe usage of new static#'
- '#Call to an undefined method Illuminate\\Support\\Collection<int, \$this\(Algolia\\ScoutExtended\\Searchable\\Aggregator\)>::searchable\(\).#'
- '#Call to an undefined method Illuminate\\Support\\Collection<int, \$this\(Algolia\\ScoutExtended\\Searchable\\Aggregator\)>::unsearchable\(\).#'
4 changes: 2 additions & 2 deletions src/Engines/AlgoliaEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ public function getClient(): SearchClient
*/
public function update($searchables)
{
dispatch_now(new UpdateJob($searchables));
dispatch_sync(new UpdateJob($searchables));
}

/**
* {@inheritdoc}
*/
public function delete($searchables)
{
dispatch_now(new DeleteJob($searchables));
dispatch_sync(new DeleteJob($searchables));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Jobs/UpdateJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function handle(SearchClient $client): void
}
}

dispatch_now(new DeleteJob(collect($searchablesToDelete)));
dispatch_sync(new DeleteJob(collect($searchablesToDelete)));

$result = $index->saveObjects($objectsToSave);
if (config('scout.synchronous', false)) {
Expand Down

0 comments on commit d27ffec

Please sign in to comment.