Created
November 16, 2016 11:46
-
-
Save willishq/c2f6b9225d59d75b29bbd0e15b446f8b to your computer and use it in GitHub Desktop.
Database transaction middleware
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use DB; | |
class TransactionMiddleware | |
{ | |
public function ($request, $next) | |
{ | |
DB::transaction(function () use ($request, $next) { | |
$next($request); | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment