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

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -