Level 73
Have you tried:
DB::table('users')->insert(YOUR_ARRAY);
and the id is most likely auto-incremented field, and it won't be affected by what you pass in your array.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
hi, i have value array like this :
^ array:2 [▼
3 => array:2 [▼
"id" => "1"
"name" => "<span>tester1</span>"
]
8 => array:2 [▼
"id" => "2"
"name" => "<span>tester2</span>"
]
]
how to insert database with query builder in controller laravel ? i need to insert all array value in dimentional
Please or to participate in this conversation.