Back

how to inser multiple rows using checkbox in laravel?


Batirbek posted 1 week ago

how to inser multiple rows using checkbox in laravel?

Elusoji sodeeq replied 1 week ago

Hi, I'd solve it this way. Since multiple checkboxes are passed to the server as an array, what I do is to loop through the array e.g

$colors = $request->colors
foreach ($colors as $color){
   Color::create($color);
}

And that should be it.


Sign in to participate in this thread!



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