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

Comments

Popular posts from this blog

ng-show doesn’t work correct with value boolean

ng-include of inline SVG does not display gradient except in Chrome