Method Illuminate\Database\Eloquent\Collection::onlyViewableInFrontend does not exist.
iff (if, and only if), the result of
\App\Models\Model::search($search_term)->get()
returns an empty collection.
Potential Solution
To make sure, that methods defined in the custom Collections class (models newCollection() method) are also valid for empty collections, you should consider to always return the custom type of the collection.
Problem
throws an exception
iff (if, and only if), the result of
returns an empty collection.
Potential Solution
To make sure, that methods defined in the custom Collections class (models newCollection() method) are also valid for empty collections, you should consider to always return the custom type of the collection.
instead of https://github.com/teamtnt/laravel-scout-tntsearch-driver/blob/b98729b0c7179218c9a5e1445922a9313d45c487/src/Engines/TNTSearchEngine.php#L200