statamic / eloquent-driver

Provides support for storing your Statamic data in a database, rather than flat files.
https://statamic.dev/tips/storing-content-in-a-database
MIT License
104 stars 71 forks source link

Refactor makeModelFromContract on assets and containers #297

Closed ryanmitchell closed 4 weeks ago

ryanmitchell commented 1 month ago

When working on https://github.com/statamic/eloquent-driver/pull/296 I noticed there was a duplication of code in AssetContainer which we should avoid.

I also took the chance to update the makeModelFromContract methods in assets and containers to not save the model, as it should only make the instance, after which you can decide if you want to save it or not.