Skip to content

Instantly share code, notes, and snippets.

@ankur13secret
Created January 4, 2016 11:24
Show Gist options
  • Save ankur13secret/6508a6c0f9b973c4dc9b to your computer and use it in GitHub Desktop.
Save ankur13secret/6508a6c0f9b973c4dc9b to your computer and use it in GitHub Desktop.
Adding Brackets in laravel 5 query
$customer = Customer::where(function($query) use ($param) {
$query->where('full_name', 'iLIKE', '%'.$param['keyword'].'%')
->orWhere('mobile', 'iLIKE', '%'.$param['keyword'].'%')
->orWhere('phone', 'iLIKE', '%'.$param['keyword'].'%');
})->where('published','1')
->where('customer_status','N')
->orderBy('full_name', 'ASC')->get();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment