first commit
This commit is contained in:
33
app/Models/Question.php
Normal file
33
app/Models/Question.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Question extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'section_id',
|
||||
'question_text',
|
||||
'type',
|
||||
'allow_other_option',
|
||||
'order',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'lain_lain' => 'boolean',
|
||||
];
|
||||
|
||||
public function section()
|
||||
{
|
||||
return $this->belongsTo(Section::class);
|
||||
}
|
||||
public function options()
|
||||
{
|
||||
return $this->hasMany(Option::class);
|
||||
}
|
||||
public function answers()
|
||||
{
|
||||
return $this->hasMany(Answer::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user