• <small id='XBHb6'></small><noframes id='XBHb6'>

    <tfoot id='XBHb6'></tfoot>
    1. <i id='XBHb6'><tr id='XBHb6'><dt id='XBHb6'><q id='XBHb6'><span id='XBHb6'><b id='XBHb6'><form id='XBHb6'><ins id='XBHb6'></ins><ul id='XBHb6'></ul><sub id='XBHb6'></sub></form><legend id='XBHb6'></legend><bdo id='XBHb6'><pre id='XBHb6'><center id='XBHb6'></center></pre></bdo></b><th id='XBHb6'></th></span></q></dt></tr></i><div id='XBHb6'><tfoot id='XBHb6'></tfoot><dl id='XBHb6'><fieldset id='XBHb6'></fieldset></dl></div>
    2. <legend id='XBHb6'><style id='XBHb6'><dir id='XBHb6'><q id='XBHb6'></q></dir></style></legend>
        <bdo id='XBHb6'></bdo><ul id='XBHb6'></ul>

      1. Laravel:Auth::user()-&gt;id 试图获取非对象的属性

        Laravel: Auth::user()-gt;id trying to get a property of a non-object(Laravel:Auth::user()-gt;id 试图获取非对象的属性)
        • <bdo id='WmONs'></bdo><ul id='WmONs'></ul>

              • <small id='WmONs'></small><noframes id='WmONs'>

                  <tbody id='WmONs'></tbody>
                1. <legend id='WmONs'><style id='WmONs'><dir id='WmONs'><q id='WmONs'></q></dir></style></legend>
                2. <tfoot id='WmONs'></tfoot>

                  <i id='WmONs'><tr id='WmONs'><dt id='WmONs'><q id='WmONs'><span id='WmONs'><b id='WmONs'><form id='WmONs'><ins id='WmONs'></ins><ul id='WmONs'></ul><sub id='WmONs'></sub></form><legend id='WmONs'></legend><bdo id='WmONs'><pre id='WmONs'><center id='WmONs'></center></pre></bdo></b><th id='WmONs'></th></span></q></dt></tr></i><div id='WmONs'><tfoot id='WmONs'></tfoot><dl id='WmONs'><fieldset id='WmONs'></fieldset></dl></div>
                  本文介绍了Laravel:Auth::user()-&gt;id 试图获取非对象的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当我提交表单以添加用户时,我收到以下错误尝试获取非对象的属性",错误显然在第一行:Auth::user()->id以下内容:

                  I'm getting the following error "trying to get a property of a non-object" when I submit a form to add a user, the error is apparently on the first line: Auth::user()->id of the following:

                  $id = Auth::user()->id;
                  $currentuser = User::find($id);
                  $usergroup = $currentuser->user_group;
                  $group = Sentry::getGroupProvider()->findById($usergroup);
                  
                  $generatedPassword = $this->_generatePassword(8,8);
                  $user = Sentry::register(array('email' => $input['email'], 'password' => $generatedPassword, 'user_group' => $usergroup));
                  
                  $user->addGroup($group);
                  

                  有什么想法吗?我已经搜索了一段时间,我看到的一切都说这应该可以正常工作.我的用户使用 Sentry 2 身份验证包登录.

                  Any ideas? I've searched for a while and everything I see says this should work fine. My user is logged in using the Sentry 2 authentication bundle.

                  推荐答案

                  如果你使用 SentrySentry::getUser()->id 检查登录用户代码>.您得到的错误是 Auth::user() 返回 NULL 并尝试从 NULL 获取 id 因此错误 trying to get a property from a non-object.

                  If you are using Sentry check the logged in user with Sentry::getUser()->id. The error you get is that the Auth::user() returns NULL and it tries to get id from NULL hence the error trying to get a property from a non-object.

                  这篇关于Laravel:Auth::user()-&gt;id 试图获取非对象的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <tbody id='qhsUM'></tbody>

                    <bdo id='qhsUM'></bdo><ul id='qhsUM'></ul>

                      • <legend id='qhsUM'><style id='qhsUM'><dir id='qhsUM'><q id='qhsUM'></q></dir></style></legend>
                      • <tfoot id='qhsUM'></tfoot>
                        <i id='qhsUM'><tr id='qhsUM'><dt id='qhsUM'><q id='qhsUM'><span id='qhsUM'><b id='qhsUM'><form id='qhsUM'><ins id='qhsUM'></ins><ul id='qhsUM'></ul><sub id='qhsUM'></sub></form><legend id='qhsUM'></legend><bdo id='qhsUM'><pre id='qhsUM'><center id='qhsUM'></center></pre></bdo></b><th id='qhsUM'></th></span></q></dt></tr></i><div id='qhsUM'><tfoot id='qhsUM'></tfoot><dl id='qhsUM'><fieldset id='qhsUM'></fieldset></dl></div>

                          <small id='qhsUM'></small><noframes id='qhsUM'>