DB::transaction(function () {
DB::table('users')->update(['votes' => 1]);
DB::table('posts')->delete();
});
如何传递参数到匿名函数内呢,如果我这样写,报错
DB::transaction(function ($a, $b, $c) {
DB::table('users')->update(['votes' => 1]);
DB::table('posts')->delete();
});
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
业精于勤,荒于嬉;行成于思,毁于随。