<?php

namespace Modules\User\Http\Resources\Invite;

use Illuminate\Http\Resources\Json\JsonResource;
use Modules\Coupon\Http\Resources\User\UserBaseResource;

class UserInviteResource extends JsonResource
{

    public function toArray($request): array
    {
        return [
            'id'         => $this->id,
            'number'     => $this->number,
            'code'       => $this->code,
            'user'       => $this->user ? new UserBaseResource($this->user) : '',
            'activeUser' => $this->activeUser ? new UserBaseResource($this->activeUser) : '',
            'actived_at' => $this->actived_at ? $this->actived_at->format('Y-m-d') : '',
        ];
    }

}