Posts Learn Components Snippets Categories Tags About

Laravel Scout Manually Triggering Indexing Via Code

Learn how to trigger indexing for Laravel Scout via code the easy way.

Created on Sep 03, 2021


To manually trigger the index of a model you can do it using code in your app or via the command line.

How to Trigger Indexing in Laravel Scout?

The way to trigger is to call the "searchable()" method at the end of the eloquent query and it will index all the records.

To manually trigger a relationship then you can refer to the model instance as follows.

$post = Post:first();

Snippets by

PostSrc poster


Full stack developer mainly focusing on the front end side of the web. The main author of PostSrc and loves writing tutorial and guides online.


PostSrc Code Components

Collection of Tailwind CSS components for everyone to use. Browse all of the components that's right for your project.

View Components

Other Code Snippets