/** * Create default where for builder * @return void */ protected function defaultBuilderWhere(Builder $builder) { $pk = $this->table->pk(); if ($pk && isset($this->data[$pk])) { $builder->where($pk, '=', $this->data[$pk]); } else { foreach ($this->data as $key => $val) { if (array_key_exists($key, $this->modifiedData)) { continue; } $builder->where($key, '=', $val); } } $builder->limit(1); }