Skip to content

Commit 4469dfe

Browse files
authored
Merge pull request #17 from aahelali/Enhance-has-role-trait
Fix duplicate get user role on HasRole trait
2 parents e4cdc57 + b61f36c commit 4469dfe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Traits/HasRoles.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ public function role()
1212
}
1313

1414
public function getRoleNameAttribute(){
15-
return $this->role()->first() ? $this->role()->first()->name : null ;
15+
return $this->role()->first()->name ?? null ;
1616
}
1717
}

0 commit comments

Comments
 (0)