create image upload endpoint create product creation endpoint create get product categories endpoint
17 lines
340 B
PHP
17 lines
340 B
PHP
<?php
|
|
|
|
namespace App\Actions;
|
|
|
|
use App\Data\UploadImageDTO;
|
|
|
|
final readonly class UploadImageAction
|
|
{
|
|
public function execute(UploadImageDTO $uploadImageDTO): void
|
|
{
|
|
$path = $uploadImageDTO->image->store('public/images');
|
|
$uploadImageDTO->product->images()->create([
|
|
'path' => $path,
|
|
]);
|
|
}
|
|
}
|