<?php

namespace App\Http\Resources;

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

class UserTypeResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        // TODO: Refactor this in the future

        // The resource will return this
        // [
        //     'value' => 'value'
        //     ...
        // ]

        $return = [];

        foreach ($this->resource as $value) {
            $return[$value] = $value;
        }

        return $return;
    }
}
