protected function isNullableKey($key)
    {
        if ( ! array_key_exists($key, $this->info->attributes)) {
            throw new RuntimeException(
                "Foreign key '{$key}' defined for relation does not exist on model " . get_class($this->model())
            );
        }

        return (bool) $this->info->attributes[ $key ]->nullable;
    }