Skip to content

Commit af74874

Browse files
committed
formatting
1 parent 27c737d commit af74874

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

scout.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,18 @@ Sometimes you may need to only make a model searchable under certain conditions.
262262
return $this->isPublished();
263263
}
264264

265-
Note that this is only applied when manipulating models through the `save` method, queries or relationships. Directly making models and collections searchable would still override this behavior.
265+
The `shouldBeSearchable` method is only applied when manipulating models through the `save` method, queries, or relationships. Directly making models or collections searchable using the `searchable` method will override the result of the `shouldBeSearchable` method:
266266

267-
// Applied to...
267+
// Will respect "shouldBeSearchable"...
268268
App\Order::where('price', '>', 100)->searchable();
269+
269270
$user->orders()->searchable();
271+
270272
$order->save();
271273

272-
// Not applied to...
274+
// Will override "shouldBeSearchable"...
273275
$orders->searchable();
276+
274277
$order->searchable();
275278

276279
<a name="searching"></a>

0 commit comments

Comments
 (0)