Description
-
Many tests are reporting as risky with no assertions - it looks like newer version of mockery & phpunit don't reliably treat
shouldReceive
as an assertion, unless you specify the number of times it should be expected. -
The scout syntax for adding extra conditions via a queryCallback is ignored when building the query:
// Proper syntax for adding (for instance) a where clause with a scout query: User::search($search_term) ->query(function ($builder) { $builder->where('created_at', '<', '2025-01-01'); }) ->get(); // Resulting query is missing the where clause. // However this works: User::search($search_term)->where('created_at', '<', '2025-01-01')->get();
Arguably nicer syntax, but should also support the official scout api with a quaryCallback.
-
Only where queries are supported, ideally should also support whereIn() and whereNotIn(), both of which are available on the Laravel\Scout\Builder::class
-
Soft delete support is not properly handled. If
soft_delete
is enabled in the scout config, the query incorrectly gets awhere('__soft_deleted', '=', 0)
clause added (by scout internals). Instead we need to replace that clause if it's present with an appropriatewhereNull()
/whereNotNull()
on the softDelete column for the model. This way we can properly handle regular queries, withTrashed and onlyTrashed.