Skip to content

Instantly share code, notes, and snippets.

@nunomaduro
Created December 19, 2018 13:30
Show Gist options
  • Save nunomaduro/23999becbf0bc6b4f5b18a53aa576df5 to your computer and use it in GitHub Desktop.
Save nunomaduro/23999becbf0bc6b4f5b18a53aa576df5 to your computer and use it in GitHub Desktop.
Scout Extended Where
<?php
$articles = Article::search('Star Trek')->where('views', '>', 100)->get();
$articles = Article::search('Star Trek')->where('created_at', '>=', now()->subDays(7))->get();
$articles = Article::search('Star Trek')->where('views', 100)->get(); // views = 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment