-
Notifications
You must be signed in to change notification settings - Fork 92
Split forms and form submissions, provide Eloquent Submission Repository and Query Builder #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ryanmitchell
merged 38 commits into
statamic:statamic-5
from
ryanmitchell:feature/form-submissions-repository
Apr 9, 2024
Merged
Split forms and form submissions, provide Eloquent Submission Repository and Query Builder #177
ryanmitchell
merged 38 commits into
statamic:statamic-5
from
ryanmitchell:feature/form-submissions-repository
Apr 9, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
duncanmcclean
added a commit
to statamic/cms
that referenced
this pull request
Apr 8, 2024
Form submissions now have a dedicated driver in the config. See statamic/eloquent-driver#177
This was referenced Apr 11, 2024
Merged
ryanmitchell
added a commit
that referenced
this pull request
Jul 1, 2024
* Add upgrade note to readme * Missing update script * Correct file path to migration * Lets not exclude parent * Split forms and form submissions, provide Eloquent Submission Repository and Query Builder (#177) * Add upgrade note to readme * Begin split configs * Use form handle to relate, rather then a database id * Defer to core methods for retrieving submissions * Update fresh migrations and add migration for existing installs * Eloquent FormRepository * Fix migration * Dont force a model type or it can't be overwritten * Missing update script * Correct file path to migration * Lets not exclude parent * StyleCI * Actually run update script * Prep for Statamic 5 * Update dev dependencies * Try again * Meh * Remove deprecated test functions * static * Migrate PHP unit config * Fix migration * Fix tests to use handle instead of id * Bug fixes * Fix form listing bugs * Split migration publish tags (#266) * Split migration tags * fix everything * Merge branch '5.x-support' into split-migration-tags * Ignore `.phpunit.cache` --------- Co-authored-by: Ryan Mitchell <ryan@thoughtcollective.com> * Statamic 5: Simplify `TestCase` (#267) * Simplify `TestCase` * Remove `partialMock` method from `TestCase` I'm not sure which "earlier versions of Laravel" this is referring to but the test suite seems to pass without it so I presume it's no longer needed. * doesn't look like we're using this method either * The `ConsoleKernel` isn't needed * Make drivers opt-in, rather than opt-out (#268) * Eloquent driver should be opt-in, not opt-out * Swap all drivers to `eloquent` in our `TestCase` * Drop status on entries (#228) * Fix asset import bug * Drop status on entries * Revert "Fix asset import bug" This reverts commit 35ebe65. * Fix test * StyleCI * Revert * Proper update script * Make status nullable in down migration * Statamic 5: Docs Refresh (#254) * Initial docs refresh * Fix tpyo * Missing space --------- Co-authored-by: Ryan Mitchell <ryan@thoughtcollective.com> * Support mapped data columns * Add tests and fix test errors by freezing time * Update `AddonTestCase` import * Fix failing tests in `EntryQueryBuilderTest` (#275) * Fix failing tests in `EntryQueryBuilderTest` * dont need to freeze time for this test * 🍺 * 🍺 * Remove accidental testcase addition * Avoid make()-ing * Refactor out hooks * Add test coverage after bringin data into COLUMNS * Not array_keys * Add assertion that it doesnt save the field to the data column * 🍺 * Remove `@test` in favour of #[Test] * Remove ::hook calls * 🍺 --------- Co-authored-by: Duncan McClean <duncan@duncanmcclean.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If/when statamic/cms#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
formrather thanform_idand use that to build the relation.Closes: #164