"required|string|confirmed|min:8|regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/", "security_code" => [ "required", "integer", Rule::exists("users")->where(function ($query) use ($that) { $query->where("id", $that->route("id")); }), ] ]; } }