eloquent - Taking user information that is stored in another table (Laravel) -
i have laravel project, , need take logged in user information stored in table.
i have tried using eloquent, no luck. example.
i have user model connects login table:
public function logininfo() { return $this->belongsto('app\logininfomodel', 'infoid'); } and logininfomodel, connection:
public function user() { return $this->hasone('app\user','userid'); } but outputting auth::user(), there no info logininfo table.
any suggestions or maybe can done not using eloquent?
thanks
auth::user() instance of user model, if have loginfo relationship on user model can do:
auth::user()->logininfo()
Comments
Post a Comment