%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/forge/api-takeaseat.eco-n-tech.co.uk/app/Http/Resources/Account/
Upload File :
Create Path :
Current File : //home/forge/api-takeaseat.eco-n-tech.co.uk/app/Http/Resources/Account/ProfileQuestionResource.php

<?php

namespace App\Http\Resources\Account;

use Illuminate\Http\Resources\Json\JsonResource;

class ProfileQuestionResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'question' => $this->question,
            'question_type' => $this->question_type,
            'answer' => $this->answers->where('question_id', $this->id)->where('therapist_id', auth()->user()->therapist->id)->first()->answer ?? ''
        ];
    }
}

Zerion Mini Shell 1.0