<?php

namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
use Storage;

class VideosResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @return array<string, mixed>
     */
    public function toArray($request)
    {
        $result = collect(parent::toArray($request))->except(['created_at', 'updated_at']);
        $result['videos'] = Storage::disk('public')->url($this->videos);
        $result['description'] = strip_tags($this->description);


        return $result;
    }
}