create image upload endpoint create product creation endpoint create get product categories endpoint
27 lines
541 B
PHP
27 lines
541 B
PHP
<?php
|
|
|
|
namespace App\Data;
|
|
|
|
use App\Contracts\OutputDataTransferObject;
|
|
|
|
final readonly class ProductImageDTO implements OutputDataTransferObject
|
|
{
|
|
public function __construct(
|
|
public ?int $id = null,
|
|
public ?string $path = null,
|
|
public ?int $productId = null,
|
|
) {}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'path' => $this->path,
|
|
'productId' => $this->productId,
|
|
];
|
|
}
|
|
}
|