第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

laravel 嘗試獲取非對(duì)象錯(cuò)誤的屬性“id”

laravel 嘗試獲取非對(duì)象錯(cuò)誤的屬性“id”

PHP
米脂 2023-06-30 16:29:55
我正在處理另一個(gè)人的代碼,當(dāng)我部署 laravel 應(yīng)用程序時(shí),登錄頁面可以工作,但是當(dāng)我輸入測(cè)試憑據(jù)時(shí),它會(huì)拋出此錯(cuò)誤    Trying to get property 'id' of non-object    in helpers.php line 159    at HandleExceptions->handleError(8, 'Trying to get property \'id\' of non-object', '/var/www/html/first-project/app/Helpers/helpers.php', 159, array('fields' => object(Collection), 'fieldsValues' => object(Collection), 'htmlFields' => array(), 'startSeparator' => '<div style="flex: 50%;max-width: 50%;padding: 0 4px;" class="column">', 'endSeparator' => '</div>', 'field' => object(CustomField), 'dynamicVars' => array('$RANDOM_VARIABLE$' => 'var15931958241638660037ble', '$FIELD_NAME$' => 'phone', '$DISABLED$' => '', '$REQUIRED$' => '"required" => "required",', '$MODEL_NAME_SNAKE$' => 'user', '$FIELD_VALUE$' => '\'+136 226 5660\'', '$INPUT_ARR_SELECTED$' => '+136 226 5660'), 'gf' => object(GeneratorField), 'value' => object(CustomFieldValue)))    in helpers.php line 159實(shí)際引用的函數(shù)如下function generateCustomField($fields, $fieldsValues = null){    $htmlFields = [];    $startSeparator = '<div style="flex: 50%;max-width: 50%;padding: 0 4px;" class="column">';    $endSeparator = '</div>';    foreach ($fields as $field) {        $dynamicVars = [            '$RANDOM_VARIABLE$' => 'var' . time() . rand() . 'ble',            '$FIELD_NAME$' => $field->name,            '$DISABLED$' => $field->disabled === true ? '"disabled" => "disabled",' : '',            '$REQUIRED$' => $field->required === true ? '"required" => "required",' : '',            '$MODEL_NAME_SNAKE$' => getOnlyClassName($field->custom_field_model),            '$FIELD_VALUE$' => 'null',            '$INPUT_ARR_SELECTED$' => '[]',        ];它在控制器中的用法如下。它在幾乎所有控制器中多次使用,例如在 UserController.php 文件中,我認(rèn)為這是調(diào)用方法。我不太熟悉 Laravel,對(duì)于任何菜鳥錯(cuò)誤提前表示歉意。
查看完整描述

2 回答

?
守著一只汪

TA貢獻(xiàn)1872條經(jīng)驗(yàn) 獲得超4個(gè)贊

你必須改變這一行

$user = $this->userRepository->findWithoutFail(auth()->id());

$user = $this->userRepository->findWithoutFail(auth()->user()->id());


查看完整回答
反對(duì) 回復(fù) 2023-06-30
?
Smart貓小萌

TA貢獻(xiàn)1911條經(jīng)驗(yàn) 獲得超7個(gè)贊

我的第一個(gè)猜測(cè),將其更改$user = $this->userRepository->findWithoutFail(auth()->id());$user = $this->userRepository->findWithoutFail(auth()->user()->id);

添加auth()->user()->id;


查看完整回答
反對(duì) 回復(fù) 2023-06-30
  • 2 回答
  • 0 關(guān)注
  • 218 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)