Skip to content

Commit

Permalink
document
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Oct 27, 2020
1 parent b69fa06 commit bc41e1d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scout.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,22 @@ The `flush` command may be used to remove all of a model's records from your sea

php artisan scout:flush "App\Models\Post"

<a name="modifying-the-import-query"></a>
#### Modifying The Import Query

If you would like to modify the query that is used to retrieve all of your models for batch importing, you may define a `makeAllSearchableUsing` method on your model. This is a great place to add any eager relationship loading that may be necessary before importing your models:

/**
* Modify the query used to retrieve models when making all of the models searchable.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
protected function makeAllSearchableUsing($query)
{
return $query->with('author');
}

<a name="adding-records"></a>
### Adding Records

Expand Down

0 comments on commit bc41e1d

Please sign in to comment.