<?php declare(strict_types=1);

namespace App\Http\Resources\Api\V1;

use App\ServiceResults\Api\V1\CaptchaService\CaptchaVerifiedResult;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

final class CaptchaVerified extends JsonResource
{
    /**
     * @var CaptchaVerifiedResult
     */
    public $resource;

    /**
     * Transform the resource into an array.
     *
     * @param  Request $request
     * @return array
     */
    public function toArray(Request $request): array
    {
        return [
            'captcha_key' => $this->resource->getKey()
        ];
    }
}
