* $customers Customer BelongsToMany relation. */ class Answer extends Model { use HasFactory; /** * The attributes that are mass assignable. * * @var string[] */ protected $fillable = [ 'answer', ]; // * RELATIONS /** * Question BelongsTo relation. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function question(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Question::class); } /** * Customer belongsToMany relation. * * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function customers(): \Illuminate\Database\Eloquent\Relations\BelongsToMany { return $this->belongsToMany(Customer::class, 'customer_answer'); } }