Skip to content

Instantly share code, notes, and snippets.

@fearrr
Last active June 7, 2017 07:11
Show Gist options
  • Save fearrr/4fad394eb1474d3a5c24e5f0f9d3333f to your computer and use it in GitHub Desktop.
Save fearrr/4fad394eb1474d3a5c24e5f0f9d3333f to your computer and use it in GitHub Desktop.
<?php
$input = [1,2,3,4,5,6,7,8];
$listing = Category::where('type', '=', 1)->where(function ($query) use ($input){
foreach ($input as $value) {
$query->orWhere('id', '=', $value);
}
});
//dd($listing->toSql());
dd($listing->get());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment