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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -