How to Insert Multiple Records in Laravel?

By Hardik Savani | June 14, 2016 | Category : Laravel

If we work on big project and then we maybe require to add multiple rows on database using laravel eloquent. Laravel provide insert method for bulk records create on db.

In bellow example you can see i use multidimensional $myItems array variable and that insert multiple records same time using DB::insert(). So let's see and try this.


$myItems = [

['title'=>'HD Topi','description'=>'It solution stuff'],

['title'=>'HD Topi 2','description'=>'It solution stuff 2'],

['title'=>'HD Topi 3','description'=>'It solution stuff 3']



Hardik Savani
My name is Hardik Savani. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.
Follow Me: Github Twitter
***Do you want me hire for your Project Work? Then Contact US.

We are Recommending you: