If we are working on a big project and then we may need to add some rows on database using laravel eloquent. Laravel provides insert method for bulk record creation in db.
In the example below you can see I'm using the multidimensional $myItems array variable and inserting multiple records at the same time using DB::insert() . So let's have a look and try this.
Example:
$myItems = [
['title'=>'HD Topi','description'=>'OOKINFO DEVELOPER'],
['title'=>'HD Topi 2','description'=>'OOKINFO DEVELOPER 2'],
['title'=>'HD Topi 3','description'=>'OOKINFO DEVELOPER 3']
];
DB::table("items")->insert($myItems);