romanbican / roles

Powerful package for handling roles and permissions in Laravel 5
MIT License
1.16k stars 297 forks source link

How I can get all users which have Role admin #206

Closed reda1987 closed 7 years ago

reda1987 commented 7 years ago

How I can get all users which have Role admin

find the solution

Auto apply to bolde.php

@php $supporter = \Bican\Roles\Models\Role::where('slug', 'supporter')->first()->users()->where('users.id','!=',Auth::user()->id)->pluck('users.name','users.id')->toArray(); @endphp you can use Role::where('slug', 'supporter')->first()->users() OR Role::find($id)->users()