feat: add survey

This commit is contained in:
2026-06-01 09:08:12 +03:30
parent b3a7edf3a5
commit a14267f54f
8 changed files with 448 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class SurveyAnswer extends Model
{
protected $fillable = ['user_id', 'survey_question_id', 'survey_option_id'];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function question(): BelongsTo
{
return $this->belongsTo(SurveyQuestion::class, 'survey_question_id');
}
public function option(): BelongsTo
{
return $this->belongsTo(SurveyOption::class, 'survey_option_id');
}
}