Support the ongoing development of Laravel.io →
Requests IOC Forms
Last updated 9 months ago.
0

My approach will be to have a class called ViewFormModel which will hold all the properties the form will display. When the form is filled, u simply update the fields in the class, serialize and save the data to session. When you ready to save it to the database, you init your DB model from the ViewFormModel and save to DB.

Reason I am using ViewFormModel is to keep the size of data small. We don't want to save an entire Eloquent model in session when we not sure we need it until after confirmation.

0

Sign in to participate in this thread!

LoadForge

Your banner here too?

mseymour mseymour Joined 25 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.

© 2023 Laravel.io - All rights reserved.