<?php

namespace App\Http\Resources;

use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Facades\Storage;

/**
 * @property mixed $id
 * @property mixed $service_name
 * @property mixed $photo
 * @property mixed $description
 */
class ServiceListResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  Request  $request
     * @return array
     */
    public function toArray($request): array
    {
        return [
            'id'=>$this->id,
            'service_name'=>$this->service_name,
            // 'photo'=>Storage::get($this->photo),
            'photo'=>url('Image/Service/'. $this->photo),
            'description'=>$this->description,
        ];
    }
}
