Download the PHP package digitaldiff/formie-quota without Composer
On this page you can find all versions of the php package digitaldiff/formie-quota. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download digitaldiff/formie-quota
More information about digitaldiff/formie-quota
Files in digitaldiff/formie-quota
Package formie-quota
Short Description A Formie Radio Buttons field where each option has a limited quota, based on completed submissions.
License proprietary
Informations about the package formie-quota
Formie Quota
Private Craft CMS 5 plugin adding a "Radio Buttons (Kontingent)" field type to Formie: a Radio Buttons field where every option has a limited quota.
Requirements
- Craft CMS 5.0+
- PHP 8.2+
- Formie 3.0+
How it works
- Each option gets a "Kontingent" number, entered in the field's options table in the form builder (alongside label, value, default, disabled).
- The remaining amount is never stored - it's computed live by counting completed, non-spam, non-deleted submissions that selected that option. Deleting a submission (or marking it as spam) frees its slot again automatically, with nothing extra to keep in sync.
- A submission is rejected on save if its selected option's quota is already used up.
- On the front-end, the remaining quota is shown in parentheses next to each
option's label, and an exhausted option's input is rendered
disabled. - Quota tracking is scoped per field instance (Formie's field UID), so using this field type on multiple forms tracks each one's quota independently - no shared quota pool across forms.
Known limitation
Counting submissions instead of maintaining a dedicated, atomically
updated counter means there is a small race window: two submissions
arriving in the same instant for the very last slot could in theory both
get through. This trade-off was made deliberately in favour of not
maintaining a separate database table. If that ever becomes a real problem,
the fix would be a SELECT ... FOR UPDATE lock on the field's own row in
formie_fields during the check, not a new table.