<?php

namespace Futage\Show\Repositories\Presenter;

use League\Fractal\TransformerAbstract;
use Hashids;

class ShowTransformer extends TransformerAbstract
{
    public function transform(\Futage\Show\Models\Show $show)
    {
        return [
            'id'                => $show->getRouteKey(),
            'key'               => [
                'public'    => $show->getPublicKey(),
                'route'     => $show->getRouteKey(),
            ], 
            'id'                => $show->id,
            'name'              => $show->name,
            'description'       => $show->description,
            'show_time'         => $show->show_time,
            'show_day'          => $show->show_day,
            'logo'              => $show->logo,
            'images'            => $show->images,
            'cast'              => $show->cast,
            'details'           => $show->details,
            'slider'            => $show->slider,
            'slug'              => $show->slug,
            'status'            => $show->status,
            'user_id'           => $show->user_id,
            'user_type'         => $show->user_type,
            'created_at'        => $show->created_at,
            'updated_at'        => $show->updated_at,
            'deleted_at'        => $show->deleted_at,
            'url'               => [
                'public'    => trans_url('show/'.$show->getPublicKey()),
                'user'      => guard_url('show/show/'.$show->getRouteKey()),
            ], 
            'status'            => trans('app.'.$show->status),
            'created_at'        => format_date($show->created_at),
            'updated_at'        => format_date($show->updated_at),
        ];
    }
}