protected function shouldCreateCollection($data): bool
    {
        if (is_array($data)) {
            return ! Arr::isAssoc($data) && ! is_scalar(Arr::first($data));
        }

        return $data instanceof Traversable;
    }
protected function shouldCreateCollection($data): bool
    {
        if (is_array($data)) {
            return ! Arr::isAssoc($data) && ! is_scalar(Arr::first($data));
        }

        return $data instanceof Traversable;
    }
protected function shouldCreateCollection ( $ data ) : bool { if ( is_array ( $ data ) ) { return ! Arr :: isAssoc ( $ data ) && ! is_scalar ( Arr :: first ( $ data ) ) ; } return $ data instanceof Traversable ; }
Indicates if the data belongs to a collection resource.

@param  mixed $data
@return bool
Indicates if the data belongs to a collection resource .