Skip to content

Commit c5bda21

Browse files
committed
Merge branch '10.x'
# Conflicts: # CHANGELOG.md # src/Scout.php
2 parents 8d61f7f + f145cf4 commit c5bda21

17 files changed

+246
-158
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
.gitignore export-ignore
1515
.styleci.yml export-ignore
1616
CHANGELOG.md export-ignore
17+
phpstan.neon.dist export-ignore
1718
phpunit.xml.dist export-ignore
1819
RELEASE.md export-ignore
1920
UPGRADE.md export-ignore

.github/ISSUE_TEMPLATE/1_Bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ about: "Report something that's broken. Please ensure your Laravel version is st
77
<!-- Fill out the FULL versions with patch versions -->
88

99
- Scout Version: #.#.#
10-
- Scout Driver: Algolia / MeiliSearch / Database / Collection
10+
- Scout Driver: Algolia / Meilisearch / Database / Collection
1111
- Laravel Version: #.#.#
1212
- PHP Version: #.#.#
1313
- Database Driver & Version:

.github/workflows/static-analysis.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: static analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '*.x'
8+
pull_request:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
tests:
15+
runs-on: ubuntu-22.04
16+
17+
strategy:
18+
fail-fast: true
19+
20+
name: Static Analysis
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v3
25+
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: 8.2
30+
tools: composer:v2
31+
coverage: none
32+
33+
- name: Install dependencies
34+
uses: nick-fields/retry@v2
35+
with:
36+
timeout_minutes: 5
37+
max_attempts: 5
38+
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
39+
40+
- name: Execute type checking
41+
run: vendor/bin/phpstan

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Release Notes
22

3-
## [Unreleased](https://github.com/laravel/scout/compare/v9.8.0...master)
3+
## [Unreleased](https://github.com/laravel/scout/compare/v9.8.1...master)
4+
5+
## [v9.8.1](https://github.com/laravel/scout/compare/v9.8.0...v9.8.1) - 2023-02-14
6+
7+
### Changed
8+
9+
- Adds types to `makeAllSearchableUsing` by @nunomaduro in https://github.com/laravel/scout/pull/660
410

511
## [v9.8.0](https://github.com/laravel/scout/compare/v9.7.2...v9.8.0) - 2023-01-17
612

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Laravel Scout provides a simple, driver-based solution for adding full-text search to your Eloquent models. Once Scout is installed and configured, it will automatically sync your model changes to your search indexes. Currently, Scout supports:
1313

1414
- [Algolia](https://www.algolia.com/)
15-
- [MeiliSearch](https://github.com/meilisearch/meilisearch)
15+
- [Meilisearch](https://github.com/meilisearch/meilisearch)
1616

1717
## Official Documentation
1818

UPGRADE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ PR: https://github.com/laravel/scout/pull/657
2929

3030
Due to the `getScoutKeyName` change discussed above, the `getUnqualifiedScoutKeyName` method was removed as it is no longer necessary.
3131

32+
### Meilisearch 1.0
33+
34+
Scout 10.x requires Meilisearch PHP 1.0 as its minimum supported SDK version; therefore, you should upgrade your dependency via your application's `composer.json` file:
35+
36+
```json
37+
"meilisearch/meilisearch-php": "^1.0",
38+
```
39+
40+
In this SDK update, all namespace and class references to "MeiliSearch" have been updated to "Meilisearch". Please review your code for any reference to the old capitalization and update those references accordingly.
41+
42+
In addition, please consult the full [Meilisearch PHP v1.0 changelog](https://github.com/meilisearch/meilisearch-php/releases/tag/v1.0.0) for further details.
43+
3244
## Upgrading To 9.0 From 8.x
3345

3446
### Minimum Laravel Version

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@
2424
"illuminate/support": "^9.0|^10.0"
2525
},
2626
"require-dev": {
27-
"meilisearch/meilisearch-php": "^0.23",
27+
"algolia/algoliasearch-client-php": "^3.2",
28+
"meilisearch/meilisearch-php": "^1.0",
2829
"mockery/mockery": "^1.0",
29-
"php-http/guzzle7-adapter": "^1.0",
3030
"orchestra/testbench": "^7.0|^8.0",
31+
"php-http/guzzle7-adapter": "^1.0",
32+
"phpstan/phpstan": "^1.10",
3133
"phpunit/phpunit": "^9.3"
3234
},
3335
"autoload": {
@@ -52,7 +54,7 @@
5254
},
5355
"suggest": {
5456
"algolia/algoliasearch-client-php": "Required to use the Algolia engine (^3.2).",
55-
"meilisearch/meilisearch-php": "Required to use the MeiliSearch engine (^0.23)."
57+
"meilisearch/meilisearch-php": "Required to use the Meilisearch engine (^1.0)."
5658
},
5759
"config": {
5860
"sort-packages": true,

config/scout.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@
118118

119119
/*
120120
|--------------------------------------------------------------------------
121-
| MeiliSearch Configuration
121+
| Meilisearch Configuration
122122
|--------------------------------------------------------------------------
123123
|
124-
| Here you may configure your MeiliSearch settings. MeiliSearch is an open
124+
| Here you may configure your Meilisearch settings. Meilisearch is an open
125125
| source search engine with minimal configuration. Below, you can state
126-
| the host and key information for your own MeiliSearch installation.
126+
| the host and key information for your own Meilisearch installation.
127127
|
128128
| See: https://docs.meilisearch.com/guides/advanced_guides/configuration.html
129129
|

phpstan.neon.dist

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
parameters:
2+
paths:
3+
- config
4+
- src
5+
6+
level: 0
7+
8+
ignoreErrors:
9+
- "#\\(void\\) is used.#"

src/Console/SyncIndexSettingsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class SyncIndexSettingsCommand extends Command
2222
*
2323
* @var string
2424
*/
25-
protected $description = 'Sync your configured index settings with your search engine (MeiliSearch)';
25+
protected $description = 'Sync your configured index settings with your search engine (Meilisearch)';
2626

2727
/**
2828
* Execute the console command.

src/EngineManager.php

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
use Laravel\Scout\Engines\AlgoliaEngine;
1111
use Laravel\Scout\Engines\CollectionEngine;
1212
use Laravel\Scout\Engines\DatabaseEngine;
13-
use Laravel\Scout\Engines\MeiliSearchEngine;
13+
use Laravel\Scout\Engines\MeilisearchEngine;
1414
use Laravel\Scout\Engines\NullEngine;
15-
use MeiliSearch\Client as MeiliSearch;
15+
use Meilisearch\Client as MeilisearchClient;
16+
use Meilisearch\Meilisearch;
1617

1718
class EngineManager extends Manager
1819
{
@@ -74,10 +75,10 @@ protected function ensureAlgoliaClientIsInstalled()
7475
}
7576

7677
if (class_exists('AlgoliaSearch\Client')) {
77-
throw new Exception('Please upgrade your Algolia client to version: ^2.2.');
78+
throw new Exception('Please upgrade your Algolia client to version: ^3.2.');
7879
}
7980

80-
throw new Exception('Please install the Algolia client: algolia/algoliasearch-client-php.');
81+
throw new Exception('Please install the suggested Algolia client: algolia/algoliasearch-client-php.');
8182
}
8283

8384
/**
@@ -107,38 +108,34 @@ protected function defaultAlgoliaHeaders()
107108
}
108109

109110
/**
110-
* Create an MeiliSearch engine instance.
111+
* Create a Meilisearch engine instance.
111112
*
112-
* @return \Laravel\Scout\Engines\MeiliSearchEngine
113+
* @return \Laravel\Scout\Engines\MeilisearchEngine
113114
*/
114115
public function createMeilisearchDriver()
115116
{
116-
$this->ensureMeiliSearchClientIsInstalled();
117-
118-
return new MeiliSearchEngine(
119-
$this->container->make(
120-
class_exists(MeiliSearch::class)
121-
? MeiliSearch::class
122-
: \Meilisearch\Client::class
123-
),
117+
$this->ensureMeilisearchClientIsInstalled();
118+
119+
return new MeilisearchEngine(
120+
$this->container->make(MeilisearchClient::class),
124121
config('scout.soft_delete', false)
125122
);
126123
}
127124

128125
/**
129-
* Ensure the MeiliSearch client is installed.
126+
* Ensure the Meilisearch client is installed.
130127
*
131128
* @return void
132129
*
133130
* @throws \Exception
134131
*/
135-
protected function ensureMeiliSearchClientIsInstalled()
132+
protected function ensureMeilisearchClientIsInstalled()
136133
{
137-
if (class_exists(MeiliSearch::class) || class_exists(\Meilisearch\Client::class)) {
134+
if (class_exists(Meilisearch::class) && version_compare(Meilisearch::VERSION, '1.0.0') >= 0) {
138135
return;
139136
}
140137

141-
throw new Exception('Please install the MeiliSearch client: meilisearch/meilisearch-php.');
138+
throw new Exception('Please install the suggested Meilisearch client: meilisearch/meilisearch-php.');
142139
}
143140

144141
/**

0 commit comments

Comments
 (0)