sarga/packages/Webkul/API/Http/Resources/Catalog/AttributeGroup.php

25 lines
605 B
PHP
Raw Normal View History

2019-03-13 11:17:52 +00:00
<?php
namespace Webkul\API\Http\Resources\Catalog;
use Illuminate\Http\Resources\Json\JsonResource;
class AttributeGroup extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request
* @return array
*/
public function toArray($request)
{
return [
2020-02-19 11:24:04 +00:00
'id' => $this->id,
'code' => $this->code,
'name' => $this->name,
2019-03-13 11:17:52 +00:00
'swatch_type' => $this->swatch_type,
2020-02-19 11:24:04 +00:00
'attributes' => Attribute::collection($this->custom_attributes)
2019-03-13 11:17:52 +00:00
];
}
}