<?php

namespace Modules\Mall\Http\Resources\Api\Goods;

use App\Api\Resources\BaseCollection;

class GoodsCollection extends BaseCollection
{

    public function toArray($request): array
    {
        return [
            'data' => $this->collection->map(function ($goods) {
                return new GoodsBaseResource($goods);
            }),
            'page' => $this->page(),
        ];
    }

}
