This commit is contained in:
2026-07-23 12:50:03 +07:00
parent db969767db
commit eee0ba6dd2
15 changed files with 914 additions and 71 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class TaxonomyResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'name' => $this->name,
'slug' => $this->slug,
'type' => [
'value' => $this->type->value,
'label' => $this->type->label(),
],
];
}
}