/** * Asserts the key is valid for the related model. */ protected function assertValidForeignKey($key) { if (!in_array($key, $this->relatedDefinition->getColumnMap(), true)) { throw new InvalidArgumentException("Invalid key '{$key}' for '{$this->relatedDefinition->getName()}'"); } }
/** * Returns the model's name. * * @return string */ public function getModelName() { return $this->definition->getName(); }