added user roles relationship

This commit is contained in:
Cüneyt Şentürk
2022-07-20 17:22:01 +03:00
parent 894c2cef1a
commit 61670c1f2d
2 changed files with 41 additions and 0 deletions

View File

@ -94,6 +94,11 @@ class User extends Authenticatable implements HasLocalePreference
return $this->hasOne('App\Models\Auth\UserInvitation', 'user_id', 'id');
}
public function roles()
{
return $this->belongsToMany('App\Models\Auth\Role', 'App\Models\Auth\UserRole');
}
/**
* Always capitalize the name when we retrieve it
*/