create image upload endpoint create product creation endpoint create get product categories endpoint
20 lines
408 B
PHP
20 lines
408 B
PHP
<?php
|
|
|
|
namespace App\Actions;
|
|
|
|
use App\Data\ProductCategoryDTO;
|
|
use App\Models\ProductCategory;
|
|
|
|
final readonly class GetAllProductCategory
|
|
{
|
|
/**
|
|
* Execute the action.
|
|
*/
|
|
public function execute(): array
|
|
{
|
|
return ProductCategory::all(columns: ['id', 'name', 'slug'])
|
|
->map(fn ($category) => ProductCategoryDTO::fromModel($category))
|
|
->toArray();
|
|
}
|
|
}
|