public function findPristinePageFields($key) { return $this->Field->newInstance()->where('key', '=', $key)->where('created_at', '=', \DB::raw('updated_at'))->get(); }
/** * Removes the pristine page fields * for this global field. We only * do this when we *first* create * the global field * * @param DvsGlobalField $global * @return void */ protected function removePristinePageFields($key) { $pristine = $this->FieldsRepository->findPristinePageFields($key); foreach ($pristine as $field) { $field->delete(); } }