Hello, i want to insert dynamic forms into the database.
Database table :
ID | DEPARTMENT_ID | CATEGORIE_ID
The html form is expandable by the user.
{{ Form::select( 'category_' . $ID , '', '' ) }}
In my solution ever row needs a own ID. And the controller have to check all possible ID's.
$ID = 0;
while(true) {
if( !Input::has('category_'.$ID) ) {
break;
}
$cat = new Categorie();
$cat->CATEGORIE_ID = Input::get('category_'.$ID);
$cat->save();
$ID++;
}
This looks not realy effective. Is there a better solution?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community