<?php

namespace Modules\Task\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;
use Jason\Api\Api;

class TaskBaseResource extends JsonResource
{

    public function toArray($request): array
    {
        $user = Api::user();

        return [
            'id'     => $this->id,
            'ico'    => $this->ico_url,
            'key'    => $this->key,
            'cover'  => $this->cover_url,
            'title'  => $this->title,
            'tips'   => $this->tips,
            'linker' => $this->linker,
            'user'   => $this->getUserTask($user),
        ];
    }

}