Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ycsm's avatar
Level 1

Using Laravel & Vue to let USERS create their own forms

Hi all. This isn't strictly a question with a definitive answer, just after some advice/guidance if you have a spare minute!

This is something I did years back with barebones PHP and some jquery.

Basically, an admin user would create a form: This is an image

Then this form was available to "regular" users to fill in. This is an image

Then this was saved to the database along with all the other people who filled in the form, and you could view the responses: This is an image

Now this was done a long while ago with some serious spaghetti code, no frameworks to speak of. Just PHP and JS/Jquery.

Now I'm moving to Laravel/Vue I'd like to be able to start doing the same kind of thing as I did with my spaghetti code back in the day.

So I suppose my question is... Is this at all possible? Difficult? Not even worth trying? Is there some kind of plugin which could do what I need?

0 likes
8 replies
Sinnbeck's avatar

I honestly don't see any problem building this sort of things with laravel/vue. It's a different approach but the only thing you need a plugin for is the text editor (if you still need that)

1 like
ycsm's avatar
Level 1

@Sinnbeck Yeah a plugin for a text editor is a breeze. It's just the procedures I'm unsure of. Rendering form inputs based on database variables - but you don't see a problem? As I remember, in the old days, I had a table for each form filled in, which related to another table that listed the main variables for the form, then another table linked to that which had all the form input types (select,text input etc), then I rendered it on the page. It was a bit all over the place. I suppose I could do the same as I did before. The logic is all the same I guess!

Sinnbeck's avatar

@ycsm I render a huge survey in react (basically the same), that features multiple choice, form inputs and much more. Every logic part is from a database

We have people who design these from scratch

Tray2's avatar

@ycsm I would say that the tricky part is a good database design for this. Both for storing the available form components, the custom forms and the values submitted from the form into the database.

furqanDev's avatar

@Tray2 and what would be a great approach to save dynamic input data in database. As there will be a DB table for the form data but not the exact columns for the data.

I know we can save it in JSON format but getting a suggestion from you would be helpful.

Tray2's avatar

@furqanDev Json is in my opinion a very bad choice.

I would probably use a structure similar to this

  • id
  • custom_form_id
  • submission_id
  • sender_id
  • key
  • value

The custom_form_id references the the custom form.

The submission_id keeps the values together for each form submission.

The sender_id is the user who submitted it.

The key is the form field name and the value is the submitted value.

And please read my blog post that @sinnbeck linked :)

1 like
furqanDev's avatar

@Tray2 I will surely read the article. I'm sure that I will find a lot of useful things there.

1 like

Please or to participate in this conversation.