- schema for cart and product - define relationship, DTO, Resource and API collections - Add post and get endpoint for cart api
20 lines
405 B
PHP
20 lines
405 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
|
|
|
class CartItemCollection extends ResourceCollection
|
|
{
|
|
/**
|
|
* Transform the resource collection into an array.
|
|
*
|
|
* @return array<int|string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return parent::toArray($request);
|
|
}
|
|
}
|