11# Laravel Scout MeiliSearch
22
33[ ![ Licence] ( https://img.shields.io/badge/licence-MIT-blue.svg )] ( https://img.shields.io/badge/licence-MIT-blue.svg )
4+ [ ![ Actions Status] ( https://github.com/meilisearch/meilisearch-php/workflows/Tests/badge.svg )] ( https://github.com/meilisearch/meilisearch-php/actions )
5+ [ ![ Latest Stable Version] ( https://poser.pugx.org/meilisearch/meilisearch-php/version )] ( https://packagist.org/packages/meilisearch/meilisearch-laravel-scout )
46
57The Laravel scout package for MeiliSearch.
68
@@ -14,6 +16,7 @@ Here is the [MeiliSearch documentation](https://docs.meilisearch.com/) 📖
1416- [ Getting started] ( #getting-started )
1517- [ Compatibility with MeiliSearch] ( #compatibility-with-meilisearch )
1618- [ Additional notes] ( #additional-notes )
19+ - [ Development Workflow] ( #development-workflow )
1720
1821## Installation
1922
@@ -84,7 +87,7 @@ class BookController extends Controller
8487 $book = new Book();
8588 $book->title = 'Pride and Prejudice';
8689 ...
87- $book->save();
90+ $book->save();
8891 }
8992}
9093```
@@ -99,7 +102,7 @@ $ php artisan scout:import "App\Book"
99102class BookController extends Controller
100103{
101104 public function search()
102- {
105+ {
103106 // MeiliSearch is typo-tolerant:
104107 Book::search('harry pottre')->get();
105108 // Or if you want to get the result from meilisearch:
@@ -114,11 +117,11 @@ class BookController extends Controller
114117class BookController extends Controller
115118{
116119 public function destroy($id)
117- {
120+ {
118121 // Delete one document
119122 Book::find($id)->delete();
120123 // Delete several documents
121- Book::destroy([1, 42]);
124+ Book::destroy([1, 42]);
122125 // Delete all documents /!\
123126 Book::query()->delete();
124127 }
@@ -144,10 +147,10 @@ All the supported options are described in [this documentation section](https://
144147class BookController extends Controller
145148{
146149 public function customSearch()
147- {
150+ {
148151 Book::search('prince', function (Index $meilisearch, $query, $options) {
149152 $options['filters'] = 'author="Antoine de Saint-Exupéry"';
150-
153+
151154 return $meilisearch->search($query, $options);
152155 })->limit(3)->get();
153156 }
@@ -160,7 +163,7 @@ class BookController extends Controller
160163class BookController extends Controller
161164{
162165 public function search()
163- {
166+ {
164167 Book::search('mustang')->paginate();
165168 // with a limit of items per page:
166169 Book::search('mustang')->paginate(5);
@@ -170,11 +173,39 @@ class BookController extends Controller
170173}
171174```
172175
176+ ## Development Workflow
177+
178+ If you want to contribute, this section describes the steps to follow.
179+
180+ Thank you for your interest in a MeiliSearch tool! ♥️
181+
182+ ### Install dependencies
183+
184+ ``` bash
185+ $ composer install
186+ ```
187+
188+ ### Tests and Linter
189+
190+ Each PR should pass the tests to be accepted.
191+
192+ ``` bash
193+ $ vendor/bin/phpunit --color tests/
194+ ```
195+
196+ ### Release
197+
198+ MeiliSearch tools follow the [ Semantic Versioning Convention] ( https://semver.org/ ) .
199+
200+ Once the changes are merged into ` master ` , you must create a release (with this name ` vX.X.X ` ) via the GitHub interface.<br >
201+ A webhook will be triggered and push the new package on [ Packagist] ( https://packagist.org/packages/meilisearch/meilisearch-laravel-scout ) .
202+
173203## Compatibility with MeiliSearch
174204
175205This package works for MeiliSearch ` >=v0.10 ` .
176206
177207## Additional notes
208+
178209You can use more advance function by reading the documentation of [ MeiliSearch PHP Client] ( https://github.com/meilisearch/meilisearch-php )
179210
180211This package is a custom engine of [ Laravel Scout] ( https://laravel.com/docs/master/scout )
0 commit comments