db instert laravel code example
Example 1: laravel db inserr
DB::table('users')->insertOrIgnore([
['id' => 1, 'email' => '[email protected]'],
['id' => 2, 'email' => '[email protected]'],
]);
Example 2: laravel db inserr
$id = DB::table('users')->insertGetId(
['email' => '[email protected]', 'votes' => 0]
);