mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-27 00:13:59 +00:00
Admin Workflow Initial Commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use App\Models\QAQuestions;
|
||||
|
||||
class QuestionnaireAnswersResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$question = QAQuestions::where('id', $this->question_id)->first();
|
||||
return [
|
||||
'question_title' => $question ? $question->question_title : null,
|
||||
'answer' => $this->answer
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user