CustomFieldResource.php 665 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Http\Resources\API;
  3. use Illuminate\Http\Request;
  4. use Illuminate\Http\Resources\Json\JsonResource;
  5. class CustomFieldResource extends JsonResource
  6. {
  7. /**
  8. * Transform the resource into an array.
  9. *
  10. * @return array<string, mixed>
  11. */
  12. public function toArray(Request $request): array
  13. {
  14. return [
  15. 'id' => $this->id,
  16. 'key' => $this->key,
  17. 'group' => $this->group,
  18. 'label' => $this->label,
  19. 'options' => $this->options,
  20. 'type' => $this->type,
  21. 'required' => $this->required,
  22. 'remark' => $this->remark,
  23. ];
  24. }
  25. }