src/Repositories/PermissionRepository.php
protected function normalizeAclPresence($data)
    {
        if ($data instanceof AclPresenceInterface) {

            $data = [ $data ];

        } elseif (is_array($data) && ! Arr::isAssoc($data)) {

            $presences = [];

            // If presences are just groupless permissions return them as-is
            foreach ($data as $nestedData) {

                if (is_string($nestedData)) {
                    $presences[] = $nestedData;
                } else {
                    $presences[] = new AclPresence($nestedData);
                }
            }

            $data = $presences;

        } else {

            $data = [ new AclPresence($data) ];
        }

        /** @var AclPresenceInterface[]|string[] $data */
        return $data;
    }
protected function normalizeAclPresence($data)
    {
        if ($data instanceof AclPresenceInterface) {

            $data = [ $data ];

        } elseif (is_array($data) && ! Arr::isAssoc($data)) {

            $presences = [];

            // If presences are just groupless permissions return them as-is
            foreach ($data as $nestedData) {

                if (is_string($nestedData)) {
                    $presences[] = $nestedData;
                } else {
                    $presences[] = new AclPresence($nestedData);
                }
            }

            $data = $presences;

        } else {

            $data = [ new AclPresence($data) ];
        }

        /** @var AclPresenceInterface[]|string[] $data */
        return $data;
    }
Normalizes menu presence data to an array of AclPresence instances.
Lists of permission slugs will remain unchanged.

@param mixed $data
@return AclPresenceInterface[]