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