<?php

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

use Illuminate\Http\Resources\Json\JsonResource;

class SpecResource extends JsonResource
{

    public function toArray($request): array
    {
        return [
            'spec_id' => $this->id,
            'name'    => $this->name,
            'values'  => SpecValueResource::collection($this->values),
        ];
    }

}