Skip to content

Commit

Permalink
spelling fix in readme and added configuration section to explain the…
Browse files Browse the repository at this point in the history
… config file
  • Loading branch information
Alex Blake committed Mar 2, 2016
1 parent 8f265b7 commit cb00d24
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Eloquent Model Searcher for Laravel 5

## Instalation
## Installation

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


## Configuration

The config file can be found in the laravel config folder at `config/eloquent_search.php`,
here you can define the classes related to your models as below.
``` php
return [
'search_models' => [
/*
Add your searchable eloquent models here, this is an example of user model usage.

If you have your models sitting in the app root as default, something like this should find them.

'user' => User::class,

Otherwise if you have them elsewhere or the application cant seem to find them, try prefix them as such.

'user' => App\Models\User::class,

*/

'user' => User::class,

]
];
```


### Additional Feature:

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

0 comments on commit cb00d24

Please sign in to comment.