Skip to content

Instantly share code, notes, and snippets.

@MicroHank
Created July 21, 2015 10:05
Show Gist options
  • Save MicroHank/626580b1aa6730858519 to your computer and use it in GitHub Desktop.
Save MicroHank/626580b1aa6730858519 to your computer and use it in GitHub Desktop.
Laravel 交易函數使用參數
交易函數可以使用一個變數
DB::transaction(function ($param) use ($param) {
$output = DB::table($param)->get();
}) ;
以下範例是錯誤的
DB::transaction(function ($p1,$p2,$p3) use ($p1,$p2,$p3) {
...code...
}) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment