<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class DomainItem extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'npsn' => $this->npsn != NULL ? $this->npsn : "",
            'name' => $this->nama_sekolah != NULL ? $this->nama_sekolah : "",
            'kecamatan' => $this->kecamatan != NULL ? $this->kecamatan : "",
            'domain' => $this->registrar_domain != NULL ? strtolower($this->registrar_domain) : "",
        ];
    }
}
