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 75 forks source link

Split forms and form submissions, provide Eloquent Submission Repository and Query Builder #177

Closed ryanmitchell closed 6 months ago

ryanmitchell commented 1 year ago

If/when https://github.com/statamic/cms/pull/6455 merges into core we will need to support an eloquent form repository. This PR will add that functionality (it can only work alongside the core PR, and tests will fail until that merges).

At the same time it makes sense to split form and submissions into a seperate config, allowing you to have form config in files and submissions in eloquent (or vice versa).

Note: due to the need to support a split config, we intentionally lose the relations between forms and submissions at the database level. We now have an index on form rather than form_id and use that to build the relation.

Closes: https://github.com/statamic/eloquent-driver/issues/164