<?php

namespace App\Http\Resources\Website;

use App\Http\Resources\Base\TranslatableResource;

class GalleryResource extends TranslatableResource
{
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'media' => $this->type === 'video' ? $this->media : asset('storage/' . $this->media),
            'type' => $this->type,
            'alt' => $this->translate('alt'),
        ];
    }
}
