$params = array( 'id' => 1, 'account' => 'OA', 'name' => "OA Wu", 'age' => 20, 'skills' => array( 'PHP', 'Java', 'C' ) ); // 新增一筆資料 $user = User::create($params);
$params1 = array( 'id' => 1, 'account' => 'OA', 'name' => "OA Wu", 'age' => 20, 'skills' => array( 'PHP', 'Java', 'C' ) ); $params2 = array( 'id' => 2, 'account' => 'OB', 'name' => "OB Wu", 'age' => 20, 'skills' => array( 'MySQL' ) ); // 新增多筆資料 $users = User::createMany(array($params1, $params2));