feat: add tags for options

This commit is contained in:
2026-06-01 09:25:25 +03:30
parent a14267f54f
commit 3d0904f630
4 changed files with 102 additions and 7 deletions
+7
View File
@@ -4,6 +4,7 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
class SurveyOption extends Model
@@ -23,4 +24,10 @@ public function answers(): HasMany
{
return $this->hasMany(SurveyAnswer::class);
}
// Tags used to suggest media when a user picks this option.
public function tags(): BelongsToMany
{
return $this->belongsToMany(Tag::class, 'survey_option_tag');
}
}