¨4.0.1¨
This commit is contained in:
24
Modules/Product/Transformers/ProductAttributeResource.php
Normal file
24
Modules/Product/Transformers/ProductAttributeResource.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Product\Transformers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ProductAttributeResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param Request
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'attribute_id' => $this->attribute_id,
|
||||
'values' => $this->values->pluck('id'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user