Closed gdebrauwer closed 1 month ago
@gdebrauwer Would it be okay to also add a method?
I use something like this to extend the query builder:
public function newEloquentBuilder($query): UserQueryBuilder
{
return new UserQueryBuilder($query);
}
To something like this:
public function newScoutBuilder($scout): UserScoutBuilder
{
return new UserScoutBuilder($scout);
}
Or is this actually discourage?
This helps a lot, because now I'm using taps
to extend Scout. :)
If you want to create a dedicated scout builder class for a model, you currently have to override the static
search()
method.This PR fixes that so you only have to define a static property on your model
This is similar to the static
$builder
and$collectionClass
properties on a model. Those properties respectively allow you to set a custom Eloquent Builder class and an Eloquent Collection class.