<?php


namespace App\Http\Transformers\Front;

use App\Models\MarketerContract;
use League\Fractal\TransformerAbstract;

class ContractTransformer extends TransformerAbstract
{

    public function __construct($type = false)
    {
        $this->type = $type;
    }

    public function transform(MarketerContract $marketerContract): array
    {

        $array = [
            'id' => (integer) $marketerContract->id,
            'ad_id' => (integer) $marketerContract->ad_id,
            'owner' => (string) $marketerContract->owner?->name,
        ];

        return $array;

    }


}
