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;
    }
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;
    }
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 ; }
Check if the value is an eloquent model.

@param  mixed  $value

@return mixed
Check if the value is an eloquent model .