feat: add tags for options
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user