亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Laravel 中出現“未定義變量:類別”錯誤

Laravel 中出現“未定義變量:類別”錯誤

PHP
夢里花落0921 2023-06-24 15:20:36
public static boolean keyEquals(RSAPrivateCrtKey k1, RSAPrivateCrtKey k2) {    final BigInteger ZERO = BigInteger.ZERO;    boolean result = true;    result = result && isConsistent(k1) && isConsistent(k2);    result = result && k1.getModulus().equals(k2.getModulus());    BigInteger lambda = computeCarmichaelLambda(k1.getPrimeP(), k1.getPrimeQ());    result = result && k1.getPublicExponent().subtract(k2.getPublicExponent()).mod(lambda).equals(ZERO);    result = result && k1.getPrivateExponent().subtract(k2.getPrivateExponent()).mod(lambda).equals(ZERO);    return result;}private static boolean isConsistent(RSAPrivateCrtKey k1) {    final BigInteger ZERO = BigInteger.ZERO;    final BigInteger ONE = BigInteger.ONE;    BigInteger n = k1.getModulus();    BigInteger p = k1.getPrimeP();    BigInteger q = k1.getPrimeQ();    BigInteger e = k1.getPublicExponent();    BigInteger d = k1.getPrivateExponent();    boolean result = true;    result = p.multiply(q).equals(n);    BigInteger lambda = computeCarmichaelLambda(p, q);    result = result && e.multiply(d).mod(lambda).equals(ONE);    result = result && d.subtract(key.getPrimeExponentP()).mod(p.subtract(ONE)).equals(ZERO);    result = result && d.subtract(key.getPrimeExponentQ()).mod(q.subtract(ONE)).equals(ZERO);    result = result && q.multiply(k1.getCrtCoefficient()).mod(p).equals(ONE);    return result;}private static BigInteger computeCarmichaelLambda(BigInteger p, BigInteger q) {    return lcm(p.subtract(BigInteger.ONE), q.subtract(BigInteger.ONE));}private static BigInteger lcm(BigInteger x, BigInteger y) {    return x.multiply(y).divide(x.gcd(y));}
查看完整描述

1 回答

?
一只甜甜圈

TA貢獻1836條經驗 獲得超5個贊

這是一個拼寫錯誤。你現在用的$request->$categories,應該是$request->categories。刪除多余的美元 ( $) 符號。

$article->categories()->attach($request->categories);


查看完整回答
反對 回復 2023-06-24
  • 1 回答
  • 0 關注
  • 168 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號