<?php

namespace App\Http\Resources\Account;

use Illuminate\Http\Resources\Json\JsonResource;

class Account extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        $out = [
            'uid'         => $this->uid,
            'name'        => $this->name,
            'billingAddress' => new Address ($this->billingAddress),
            'slug'        => $this->slug,
            'plan'        => new Plan($this->plan),
        ];

        return $out;
    }
}
