<?php

namespace App\Http\Resources;

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

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