0

我无法将哨兵用户的电子邮件传递到我的数据库。我可以成功传递用户的 ID,但不能传递电子邮件。

public static function loggedInUser()
{
    $user = Sentry::getUser();

    if ( isset($user) )
    {
        return $user;
    }
}

public static function loggedInUserEmail()
{
    $user = Sentry::getUser(); 
            $email = $user->email;

    if ( isset($email) )
    {
        return $email;
    }
}

public function store()
{
            $id = Helpers::loggedInUser()->id;  // this works
            $email = Helpers::loggedInUserEmail()->email(); //i have tried also
            $email = Helpers::loggedInUserEmail()->email; //i have tried also
            $email = Helpers::loggedInUser()->email; //i have tried also
            $email = Helpers::loggedInUser()->email(); //i have tried also
            $input['email'] = $email;      
            $input['creator_id'] = $id;
    $this->actor->create($input);
}
4

1 回答 1

0

我不知道 Sentry,但在这种情况下,我认为您应该尝试打印对象及其方法。接下来你肯定会有一些想法。

问候

于 2014-02-13T06:08:08.777 回答