riasvdv / statamic-redirect

Redirect allows you to redirect legacy URLs, so that you don't lose SEO value when rebuilding & restructuring a website.
https://statamic.com/addons/rias/redirect
19 stars 21 forks source link

Fix eloquent redirects not updating #160

Closed vluijkx closed 5 months ago

vluijkx commented 5 months ago

toModel() currently uses firstOrNew to turn a redirect data-object into a model.

However, firstOrNew does not update the first object with the updated properties. Instead, it just returns the outdated model. Which is why you currently can not update eloquent redirects.