protected function scopeRoles(&$builder)
    {
        return (config('antares/acl::allow_register_with_other_roles')) ? $builder->administrators() :
                $builder->with('roles')->whereNotNull('tbl_users.id')->whereHas('roles', function ($query) {
                    $query->whereIn('tbl_roles.id', user()->roles->pluck('id')->toArray());
                });
    }
protected function scopeRoles(&$builder)
    {
        return (config('antares/acl::allow_register_with_other_roles')) ? $builder->administrators() :
                $builder->with('roles')->whereNotNull('tbl_users.id')->whereHas('roles', function ($query) {
                    $query->whereIn('tbl_roles.id', user()->roles->pluck('id')->toArray());
                });
    }
protected function scopeRoles ( & $ builder ) { return ( config ( 'antares/acl::allow_register_with_other_roles' ) ) ? $ builder -> administrators ( ) : $ builder -> with ( 'roles' ) -> whereNotNull ( 'tbl_users.id' ) -> whereHas ( 'roles' , function ( $ query ) { $ query -> whereIn ( 'tbl_roles.id' , user ( ) -> roles -> pluck ( 'id' ) -> toArray ( ) ) ; } ) ; }
Scopes roles by configuration

@param \Illuminate\Database\Query\Builder $builder
@return \Illuminate\Database\Query\Builder
Scopes roles by configuration