<?php

declare(strict_types=1);

namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class FaqResource extends JsonResource
{
  public function toArray(Request $request): array
  {
    return [
      'id' => $this->id,
      'question' => $this->question,
      'response' => $this->response,
      'answer' => $this->response,
      'body' => $this->response,
      'order' => $this->order,
      'status' => $this->status,
      'model_type' => class_basename($this->model_type),
      'model_id' => $this->model_id,
      'created_at' => $this->created_at?->toISOString(),
      'updated_at' => $this->updated_at?->toISOString(),
    ];
  }
}
