1、 $id = DB::getPdo()->lastInsertId(); 2、 $arr = ['id'=>1,'name'=>'bob']; $id = DB::table()->insertGetId($arr);