closure funtion laravel code example
Example: laravel where closure
$externalValue = "User";
$users = User::where(function ($query) use($externalValue) {
return $query->where('type','Admin')->orWhere('type',$externalValue);
})->where("role",1)->get();