diff --git a/src/Traits/HasRoles.php b/src/Traits/HasRoles.php index 7b55cfb..9d18873 100644 --- a/src/Traits/HasRoles.php +++ b/src/Traits/HasRoles.php @@ -10,4 +10,8 @@ public function role() { return $this->belongsTo(Role::class); } + + public function getRoleNameAttribute(){ + return $this->role()->first() ? $this->role()->first()->name : null ; + } }