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;
use Illuminate\Database\Eloquent\Relations\HasMany;
class SurveyOption extends Model
{
protected $fillable = ['survey_question_id', 'label', 'value', 'order'];
protected $casts = [
'order' => 'integer',
];
public function question(): BelongsTo
{
return $this->belongsTo(SurveyQuestion::class, 'survey_question_id');
}
public function answers(): HasMany
{
return $this->hasMany(SurveyAnswer::class);
}
}