You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 31, 2018. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+54-57Lines changed: 54 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,45 +1,38 @@
1
-
Algolia Search for Laravel
2
-
==================
1
+
# Laravel Algolia Search
3
2
4
-
This php package integrate the Algolia Search API to your favorite Laravel Eloquent ORM. It's based on the [algoliasearch-client-php](https://github.com/algolia/algoliasearch-client-php) package. Php 5.4+ is supported.
3
+
This php package integrate the Algolia Search API to your favorite Laravel Eloquent ORM. It's based on the [algoliasearch-client-php](https://github.com/algolia/algoliasearch-client-php) package. PHP 5.5.9+ is supported.
Laravel Algolia requires connection configuration. To get started, you'll need to publish all vendor assets:
45
38
@@ -49,15 +42,14 @@ php artisan vendor:publish
49
42
50
43
This will create a `config/algolia.php` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.
51
44
52
-
53
-
54
-
Quick Start
55
-
-------------
45
+
## Quick Start
56
46
57
47
The following code will create a <code>Contact</code> add search capabilities to your <code>Contact</code> model:
58
48
59
49
```php
60
-
class Contact extends \Illuminate\Database\Eloquent\Model
50
+
use Illuminate\Database\Eloquent\Model;
51
+
52
+
class Contact extends Model
61
53
{
62
54
use AlgoliaEloquentTrait;
63
55
}
@@ -68,7 +60,9 @@ By default all your visible attributes will be send
68
60
If you want to send specific attributes you can do something like
69
61
70
62
```php
71
-
class Contact extends \Illuminate\Database\Eloquent\Model
63
+
use Illuminate\Database\Eloquent\Model;
64
+
65
+
class Contact extends Model
72
66
{
73
67
use AlgoliaEloquentTrait;
74
68
@@ -88,14 +82,16 @@ class Contact extends \Illuminate\Database\Eloquent\Model
88
82
We provide many ways to configure your index allowing you to tune your overall index relevancy. The most important ones are the **searchable attributes** and the attributes reflecting **record popularity**.
89
83
90
84
```php
91
-
class Contact extends \Illuminate\Database\Eloquent\Model
@@ -129,10 +125,9 @@ You could also use `search` but it's not recommended. This method will search on
129
125
Contact::search("jon doe");
130
126
```
131
127
132
-
Options
133
-
----------
128
+
## Options
134
129
135
-
#### Auto-indexing & asynchronism
130
+
#### Auto-indexing & Asynchronism
136
131
137
132
Each time a record is saved; it will be - asynchronously - indexed. On the other hand, each time a record is destroyed, it will be - asynchronously - removed from the index.
138
133
@@ -152,15 +147,16 @@ You can temporary disable auto-indexing. This is often used for performance reas
0 commit comments