I've following query:
$visible = array(1,2,3);
$views = DB::table('ims_view')
->Where(function($query) {
$query->where('iv_status', 1)->whereIn('id', $visible);
})->orderBy('iv_name', 'asc')->get();
Error: Undefined variable: visible
How to pass the variabnle to inner where?