- implement DTO for product and modify productImageDTO. - add products resources and collection.
17 lines
312 B
PHP
17 lines
312 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
|
|
|
class ProductCollection extends ResourceCollection
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'data' => $this->collection,
|
|
];
|
|
}
|
|
}
|