%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/klinisol/klinisol-api/app/Models/
Upload File :
Create Path :
Current File : /var/www/html/klinisol/klinisol-api/app/Models/Answer.php

<?php

namespace App\Models;

/**
 * @property integer id
 * @property integer question_id
 * @property integer submission_id
 * @property string answer
 * @property string extra_field_answer
 * @property Question question
 * @property Submission submission
 */
class Answer extends BaseModel
{
    protected $table = 'answers';

    protected $fillable = [
        'question_id',
        'submission_id',
        'answer',
        'extra_field_answer',
    ];

    protected $casts = [
        'id'                 => 'int',
        'question_id'        => 'int',
        'submission_id'      => 'int',
        'answer'             => 'string',
        'extra_field_answer' => 'string',
    ];

    public function question()
    {
        return $this->belongsTo(Question::class);
    }

    public function shortAnswer()
    {
        return $this->answer == 'yes'
            ? 'Y'
            : 'N';
    }
}

Zerion Mini Shell 1.0