You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.
When searching, it isn't possible to pass custom calls to the MySQL engine. A (very very very) ugly workaround is to overwrite the search method to disable scopes before passing the model to the engine:
public static function search(string $query, $callback = null): Collection
{
// Temporary disable global scopes
static::$globalScopes = [];
$results = (new ScoutBuilder(new static(), $query, $callback))->get();
static::addGlobalScope(new UserScope());
return $results;
}
Any other ideas how to resolve this in a more elegant way?
The text was updated successfully, but these errors were encountered:
When using global scopes, in my case based on user permission, and you want to disable those scopes for fetching, normally you can do something like:
When searching, it isn't possible to pass custom calls to the MySQL engine. A (very very very) ugly workaround is to overwrite the
search
method to disable scopes before passing the model to the engine:Any other ideas how to resolve this in a more elegant way?
The text was updated successfully, but these errors were encountered: