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

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?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Tuturials tuturials Joined 11 Jul 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.