roles icon indicating copy to clipboard operation
roles copied to clipboard

Get role slug

Open Porcar opened this issue 10 years ago • 2 comments

I have a users table with all the users in my DB. I need one of the columns to show the role slug.

How can i get it?

Thanks

Porcar avatar Oct 04 '15 20:10 Porcar

I need this too. An answer would be appreciated

Dito-Orkodashvili avatar Apr 26 '16 10:04 Dito-Orkodashvili

Pretty old question, it's open so anyway... I think the only way is using a foreach:

foreach( Auth::user()->roles as $role ) echo $role->slug;

We can change it a little bit to get last, first, or highest role.

ghost avatar Jul 03 '16 16:07 ghost