You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wx.sstbc.com/app/Models/CourseContentEvaluationForm...

23 lines
573 B

1 year ago
<?php
namespace App\Models;
class CourseContentEvaluationForm extends SoftDeletesModel
{
3 weeks ago
protected $appends = ['respondent'];
public function getRespondentAttribute(): array
{
$user = $this->relationLoaded('user') ? $this->getRelation('user') : User::find($this->user_id);
return \App\Services\Survey\SurveyIdentity::respondent($user, $this->data, $this->snapshot);
}
1 month ago
protected $casts = ['data' => 'json', 'snapshot' => 'array'];
1 year ago
1 year ago
public function user()
{
return $this->hasOne(User::class, 'id', 'user_id');
}
1 year ago
}