protected function insertAndSetId($query, $attributes) { $keyName = $this->getKeyName(); $this->setAttribute($keyName, $query->save($attributes)); }