Method Laravel\Scout\Builder::with does not exist

While I am using this code to search and filter which is present in documentation,

$articles = Article::search('Star Trek')
    ->with([
        'hitsPerPage' => 30,
        'filters' => 'attribute:value',
        'typoTolerance' => false,
    ])->get();

It throws an error.

BadMethodCallException

Method Laravel\Scout\Builder::with does not exist.

Please help me to solve please this is very important for me

1 Like

This snippets requires Scout Extended.

Extended is our package to add some feature to the official Laravel Scout. It will replace the Laravel\Scout\Builder by Algolia\ScoutExtended\Builder.

Installing Scout Extended: