Created API endpoints
This commit is contained in:
24
app/Transformers/QuestionchoiceTransformer.php
Normal file
24
app/Transformers/QuestionchoiceTransformer.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Transformers;
|
||||
|
||||
use App\Models\Questionchoice as Model;
|
||||
use League\Fractal\TransformerAbstract;
|
||||
|
||||
class QuestionchoiceTransformer extends TransformerAbstract
|
||||
{
|
||||
/**
|
||||
* @param Model $model
|
||||
* @return array
|
||||
*/
|
||||
public function transform(Model $model)
|
||||
{
|
||||
return [
|
||||
'id' => $model->id,
|
||||
'number' => $model->number,
|
||||
'text' => $model->text,
|
||||
'fillable' => $model->fillable,
|
||||
'description' => $model->description
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user