Support the ongoing development of Laravel.io →
Eloquent Forms Architecture

I'm trying to figure out a way to elegantly generate a form when creating a new entry based off a model.

Let's say I want to create a new user. I want to be able to pass a new instance of the user model to a form generator (a class i'm working on) which will then return a form based on the columns belonging to, in this case, the user model. I can then pass that to my view and simply render it there.

The reason I want to do this is so that I don't have to create the same view over and over again. Perhaps someone has an elegant solution with regards to form generation. Or perhaps it's just bad practice to do it like this and I should stick to adding fields to the view manually.

I'd like to hear suggestions

Last updated 2 years ago.
0

https://github.com/FrozenNode/Laravel-Administrator https://github.com/lazychaser/cruddy And possibly others.

I tried doing something similar myself, but still not really happy with any solutions. I think I'll stick with using a generator to generate the boilerplate stuff.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Ortix92 ortix92 Joined 8 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.