Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "whereNotIn" native support to Meilisearch, Database and Collection engines #760

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

guestpectacular
Copy link
Contributor

I have introduced the "whereNotIn" support to the Scout query builder to be used with Meilisearch, to continue with elegant and readable code following Laravel's coding standards:

Eliminates the need for previous hackish workarounds, example:

Model::search('foo', function ($engine, $query, $options) { 
  $options['filter'] = 'id NOT IN ['.implode(',', [1,2,3]).']';
  return $meilisearch->search($query, $options);
})->get()

Transformed into:

Model::search('foo')->whereNotIn('id',[1,2,3])->get()

I apologize for not including Algolia support, since its paid service and I don't have an active account with them to write and run all tests.

Best
Edgar Pimienta

@taylorotwell taylorotwell merged commit 9b45a42 into laravel:10.x Sep 1, 2023
6 checks passed
@driesvints
Copy link
Member

@guestpectacular Thanks! Can you also send in a PR to the docs for this?

@guestpectacular
Copy link
Contributor Author

Sure, it's done @driesvints

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants