How can I save multiple data from the html table to the database by just one saving?
3 Answers
The only way to insert multiple rows at once is using Model::insert($data). To use this method, you should prepare data first. Here's correct data structure for insert() method:
$data = [
['name' => 'John', 'age' => 32],
['name' => 'Steve', 'age' => 25],
['name' => 'Mari', 'age' => 20],
];