Skip to content

Commit

Permalink
Merge pull request #17 from aahelali/Enhance-has-role-trait
Browse files Browse the repository at this point in the history
Fix duplicate get user role on HasRole trait
  • Loading branch information
amiryousefi committed Mar 26, 2022
2 parents e4cdc57 + b61f36c commit 4469dfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Traits/HasRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public function role()
}

public function getRoleNameAttribute(){
return $this->role()->first() ? $this->role()->first()->name : null ;
return $this->role()->first()->name ?? null ;
}
}

0 comments on commit 4469dfe

Please sign in to comment.