laravel pass value input to eluquent where clause 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');
})