getPrimaryKeys() as $primaryKey) { $query->where($primaryKey, $this->getAttribute($primaryKey)); } return $query; } /** * Get the composite primary key for the pivot. * * @return string[] */ abstract protected function getPrimaryKeys(): array; }