in function in where larave code example
Example: orWhere(function() pass parameter
->where(function ($query) use($locale) {
$query->where('news.language', $locale)
->orWhere('news.language', 'all');
})
->where(function ($query) use($locale) {
$query->where('news.language', $locale)
->orWhere('news.language', 'all');
})