Install voyager and read the code.!
Custom form built by the admin and then displayed to be filled by users - How to do that ?
Hello,
I will perhaps have to work on an app which needs for the admins to create projects with different steps. Each step has to be customizable with different fields : input, text, select, checkbox, radio, upload, validation by some referent user, generation of custom PDF docs from the data, ...
I never did that, I only began to think about.
- Has someone already done something like that ?
- Is there any Laravel (or not Laravel) package which help doing that ?
- Is it a good idea to have a
stepstable with aJSONcolumn to save the custom fields ? and then another table to save the data when users fill and save the form ? - Other ideas ?
While waiting for some help, I want to test the JSON idea. I'll tell you if it works for me or not.
Thanks for your help.
Vincent
@vincent15000 Shoving stuff in JSON in never “best practice” when using a relational database. If you’re using a relational database like MySQL or PostgreSQL, then store data relationally, i.e. in dedicated tables linked with foreign keys.
If you want custom forms then you need to identify the entities in that. At its simplest, you’re going to have a forms table, and then your Form model is going to have a has-many relation pointing to a FormField model or something.
Please or to participate in this conversation.