feat(category): implement category configuration management with sorting and validation

This commit is contained in:
2026-10-01 15:08:05 -03:00
parent 5ddc304435
commit 007ba9d572
11 changed files with 588 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Domains\Commerce\Catalog\Resources\AdminApp;
use App\Domains\Commerce\Catalog\Models\Category;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
/** @mixin Category */
class CategoryConfigurationResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'nombre' => $this->nombre,
'is_enabled' => $this->is_enabled,
'banner_enabled' => $this->banner_enabled,
'banner_key' => $this->banner?->key,
'banner_name' => $this->banner?->filename,
'banner_url' => $this->banner?->getTemporaryUrl(1440),
'subcategories' => self::collection($this->subCategories),
];
}
}