<?php

namespace App\Resources;

use Wibiesana\Padi\Core\Resource;

class SarprasRuanganResource extends Resource
{
    public function toArray($request): array
    {
        return [
            'id' => $this->id,
            'bangunan_id' => $this->bangunan_id,
            'kode_ruangan' => $this->kode_ruangan,
            'nama_ruangan' => $this->nama_ruangan,
            'tipe_ruangan' => $this->tipe_ruangan,
            'lantai' => $this->lantai,
            'kapasitas' => $this->kapasitas,
            'luas' => $this->luas,
            'kondisi' => $this->kondisi,
            'keterangan' => $this->keterangan,
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
            'bangunan_nama' => $this->bangunan_nama ?? null,
            'bangunan' => $this->whenLoaded('bangunan')
        ];
    }
}
