searchable
searchable copied to clipboard
Doesn’t search soft deletes
When using withTrashed it still only finds non-soft deleted items
where
users.
deleted_at is null
I've ran into this issue today. What worked for me was to call withTrashed
before the search.
It was:
public function index() {
// ...
$users = User::search($query)->withTrashed()->paginate();
// ...
}
Fixed by changing to:
public function index() {
// ...
$users = User::withTrashed()->search($query)->paginate();
// ...
}