31 lines
546 B
PHP
31 lines
546 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Response extends Model
|
|
{
|
|
protected $fillable = [
|
|
'survey_id',
|
|
'user_id',
|
|
'respondent_name',
|
|
'respondent_no_pekerja',
|
|
'respondent_jabatan',
|
|
];
|
|
|
|
|
|
public function survey()
|
|
{
|
|
return $this->belongsTo(Survey::class);
|
|
}
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
} // Responden
|
|
public function answers()
|
|
{
|
|
return $this->hasMany(Answer::class);
|
|
}
|
|
}
|