简体   繁体   中英

insert multiple rows using eloquent

So I'm trying to do an array insert of multiple rows using eloquent, but I don't see any obvious way to do this in the docs. So I don't know if there's a best practice way, or if I should just for-each my way through those inserts. Does anybody know of oa smarter way?

It's only rows in a relationstable with both columns being foreign keys referencing the same primary key in another table.

您可以将插入方法用于多行,如下所示: http://jasonlewis.me/article/laravel-and-eloquent-part-1-basics

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM