src/Gzero/Core/Models/User.php
private function buildPermissionsMap()
    {
        $permissionsMap = [];
        $roles          = $this->roles()->with('permissions')->get()->toArray();
        foreach ($roles as $role) {
            if (!empty($role['permissions'])) {
                foreach ($role['permissions'] as $permission) {
                    $permissionsMap[] = $permission['name'];
                }
            }
        }
        return array_unique($permissionsMap);
    }
private function buildPermissionsMap()
    {
        $permissionsMap = [];
        $roles          = $this->roles()->with('permissions')->get()->toArray();
        foreach ($roles as $role) {
            if (!empty($role['permissions'])) {
                foreach ($role['permissions'] as $permission) {
                    $permissionsMap[] = $permission['name'];
                }
            }
        }
        return array_unique($permissionsMap);
    }
private function buildPermissionsMap ( ) { $ permissionsMap = [ ] ; $ roles = $ this -> roles ( ) -> with ( 'permissions' ) -> get ( ) -> toArray ( ) ; foreach ( $ roles as $ role ) { if ( ! empty ( $ role [ 'permissions' ] ) ) { foreach ( $ role [ 'permissions' ] as $ permission ) { $ permissionsMap [ ] = $ permission [ 'name' ] ; } } } return array_unique ( $ permissionsMap ) ; }
It build permission map.
Later we store this map cache.

@return array
It build permission map . Later we store this map cache .