src/Models/User.php
public function getManagedRoles(): Collection
    {
        if ($this->isA('superadmin')) {
            $roles = app('cortex.auth.role')->all();
        } elseif ($this->isA('supermanager')) {
            $roles = $this->roles->merge(config('rinvex.tenants.active') ? app('cortex.auth.role')->where('scope', config('rinvex.tenants.active')->getKey())->get() : collect());
        } else {
            $roles = $this->roles;
        }

        return $roles->pluck('title', 'id')->sort();
    }
public function getManagedRoles(): Collection
    {
        if ($this->isA('superadmin')) {
            $roles = app('cortex.auth.role')->all();
        } elseif ($this->isA('supermanager')) {
            $roles = $this->roles->merge(config('rinvex.tenants.active') ? app('cortex.auth.role')->where('scope', config('rinvex.tenants.active')->getKey())->get() : collect());
        } else {
            $roles = $this->roles;
        }

        return $roles->pluck('title', 'id')->sort();
    }
public function getManagedRoles ( ) : Collection { if ( $ this -> isA ( 'superadmin' ) ) { $ roles = app ( 'cortex.auth.role' ) -> all ( ) ; } elseif ( $ this -> isA ( 'supermanager' ) ) { $ roles = $ this -> roles -> merge ( config ( 'rinvex.tenants.active' ) ? app ( 'cortex.auth.role' ) -> where ( 'scope' , config ( 'rinvex.tenants.active' ) -> getKey ( ) ) -> get ( ) : collect ( ) ) ; } else { $ roles = $ this -> roles ; } return $ roles -> pluck ( 'title' , 'id' ) -> sort ( ) ; }
Get managed roles.

@return \Illuminate\Support\Collection
Get managed roles .