【发布时间】:2014-06-09 19:46:07
【问题描述】:
我正在使用 Laravel 4.1,并使用带有哨兵的facebook/php-sdk 实际上它来自这个问题的答案:
Facebook Login with Sentry, A password is required for user [email], none given
此代码不再起作用:
$profile = $user->profiles()->save($profile);
抛出此错误:
如何解决?
这里有路线Route code
我的模型如下:
轮廓模型:
<?php
class Profile extends \Eloquent {
public function user()
{
return $this->belongsTo('User');
}
}
用户模型包含:
public function profiles()
{
return $this->hasMany('Profile');
}
【问题讨论】:
-
你是否在 User 模型中创建了 hasMany 关系(profiles 方法)?
-
是的,让我用模型的代码更新我的问题
-
@user1279647- 编辑了我的代码
-
你用这个方法自定义模型哨兵吗(forums.laravel.io/viewtopic.php?pid=48274#p48274)?
-
解决了我的问题,谢谢
标签: php laravel-4 oauth-2.0 facebook-oauth cartalyst-sentry