File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Eloquent Model Searcher for Laravel 5
2
2
3
- ## Instalation
3
+ ## Installation
4
4
5
5
Add this line to your ` providers ` array:
6
6
``` php
@@ -15,6 +15,34 @@ You will need to run `php artisan vendor:publish` to publish the config file to
15
15
Once run, you can find it in ` config/eloquenet_search.php ` .
16
16
This config file is used to controll which models are used to search/return entities of.
17
17
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
+
18
46
### Additional Feature:
19
47
20
48
Implement the method 'isSearchable' in your models for the searcher to determine if it is allowed to search/return that model.
You can’t perform that action at this time.
0 commit comments