How to save dynamical fields to database the problem is i don't know the names of fields we have module the user will add fields with name dynamically and i will save that fields names in database when the user checks the form for example he added fields in posts form so i want to save that fields data to database.
Example
<form>
<input type="text" name="firstname" id="firstname">
<?php foreach($extrafields as $extrafields1 )
{
?>
<input type="<?php $extrafields1->type; ?>" name="<?php $extrafields1->name; ?>" id="<?php $extrafields1->id; ?>" <?php $extrafields1->extraparameters; ?>>
<?php
}
</form>
You shouldn't let's user add dynamically fields, you must find out a way which can control those fields.
You can create a model for the dynamic fields then save them as records to your database linked to the form/post (not sure what you are trying to achieve). In any case you are doing this be careful how you handle data, you are already giving your users too much freedom.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community