private function checkIfValueIsEloquentModel($value)
    {
        if ($value instanceof EloquentModel) {
            foreach ($this->getConfig('routes.model-columns', ['id']) as $column) {
                if (
                    array_key_exists($column, $attributes = $value->getAttributes()) &&
                    ! is_null($attributes[$column])
                ) {
                    return $attributes[$column];
                }
            }
        }

        return $value;
    }