/** * Insert the given attributes and set the ID on the model. * * @param \LMongo\Eloquent\Builder $query * @param array $attributes * @return void */ protected function insertAndSetId($query, $attributes) { $keyName = $this->getKeyName(); $this->setAttribute($keyName, $query->save($attributes)); }