Monday, March 26, 2018

How to get access to relationship in model User Laravel? - development

How to get access to relationship in model User Laravel?

I have default User model:

class User extends Authenticatable implements HasRoleContract
{
    use Notifiable, HasRole;

}

With one relationship inside:

public function distributor() {

    return $this->hasOne('AppDistributorContacts', 'distributor_id', 'id');
}

So, when user passed authorization I can not see this relation in object:



enter image description here



from Laravel Questions and Answers https://laravelquestions.com/laravel/how-to-get-access-to-relationship-in-model-user-laravel/
via Lzo Media

No comments:

Post a Comment