sarga/packages/Sarga/API/Http/Resources/Customer/FolderResource.php

26 lines
644 B
PHP
Raw Normal View History

2023-03-03 12:02:29 +00:00
<?php
namespace Sarga\API\Http\Resources\Customer;
2023-03-08 11:32:01 +00:00
use Illuminate\Http\Resources\Json\JsonResource;
use Sarga\API\Http\Resources\Customer\WishListResource;
class FolderResource extends JsonResource
2023-03-03 12:02:29 +00:00
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'id' => $this->id,
'name' => $this->name,
2023-03-12 07:56:05 +00:00
'items' => WishlistResource::collection($this->wishlist),
'items_count' => $this->wishlist_count ?? 0
2023-03-03 12:02:29 +00:00
];
}
}