Skip to content

Commit cb00d24

Browse files
author
Alex Blake
committed
spelling fix in readme and added configuration section to explain the config file
1 parent 8f265b7 commit cb00d24

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Eloquent Model Searcher for Laravel 5
22

3-
## Instalation
3+
## Installation
44

55
Add this line to your `providers` array:
66
``` php
@@ -15,6 +15,34 @@ You will need to run `php artisan vendor:publish` to publish the config file to
1515
Once run, you can find it in `config/eloquenet_search.php`.
1616
This config file is used to controll which models are used to search/return entities of.
1717

18+
19+
## Configuration
20+
21+
The config file can be found in the laravel config folder at `config/eloquent_search.php`,
22+
here you can define the classes related to your models as below.
23+
``` php
24+
return [
25+
'search_models' => [
26+
/*
27+
Add your searchable eloquent models here, this is an example of user model usage.
28+
29+
If you have your models sitting in the app root as default, something like this should find them.
30+
31+
'user' => User::class,
32+
33+
Otherwise if you have them elsewhere or the application cant seem to find them, try prefix them as such.
34+
35+
'user' => App\Models\User::class,
36+
37+
*/
38+
39+
'user' => User::class,
40+
41+
]
42+
];
43+
```
44+
45+
1846
### Additional Feature:
1947

2048
Implement the method 'isSearchable' in your models for the searcher to determine if it is allowed to search/return that model.

0 commit comments

Comments
 (0)