라라벨 쿼리빌더 insert

1 개요[ | ]

Laravel Query Builder 삽입
라라벨 쿼리빌더 Insert
PHP
Copy
DB::table('users')->insert(
    ['email' => 'john@example.com', 'votes' => 0]
);
PHP
Copy
DB::table('users')->insert([
    ['email' => 'taylor@example.com', 'votes' => 0],
    ['email' => 'dayle@example.com', 'votes' => 0]
]);
PHP
Copy
$id = DB::table('users')->insertGetId(
    ['email' => 'john@example.com', 'votes' => 0]
);

2 같이 보기[ | ]

3 참고[ | ]