SkyCoder
3 months ago
249
3
Laravel

Get users with admin role from jeremykenedy/laravel-roles

Posted 3 months ago by SkyCoder
User::whereHas('roles', function($q){
            $q->hasRole('Admin');
        })->has('posts')->get()

How can I check if rows have Admin role from jeremykenedy/laravel-roles package within query builder?

Please sign in or create an account to participate in this conversation.