Releases: waska14/laravel-with-db-transactions
Releases · waska14/laravel-with-db-transactions
v4.0.0
v3.0.0
Before and after actions / events
After version 2.0.0 you can define closures that will be executed before/after commit/rollback(s).
There are 6 static functions that you can call with Waska\LaravelWithDBTransactions\Helpers\WithDBTransactions class:
WithDBTransactions::beforeCommit(callable $closure); // Before committing database transaction
WithDBTransactions::afterCommit(callable $closure); // After committing database transaction
WithDBTransactions::beforeRollback(callable $closure); // Before last rollback
WithDBTransactions::afterRollback(callable $closure); // After last rollback
WithDBTransactions::beforeEveryRollback(callable $closure); // Before every (except last) rollback
WithDBTransactions::afterEveryRollback(callable $closure); // After every (except last) rollbackAfter version 2.0.0 package dispatches events also.
You can listen them and do whatever you want in listener.
List of events:
\Waska\LaravelWithDBTransactions\Events\BeforeBeginTransactionEventBefore begin transaction\Waska\LaravelWithDBTransactions\Events\AfterBeginTransactionEventAfter begin transaction\Waska\LaravelWithDBTransactions\Events\BeforeCommitEventBefore commit\Waska\LaravelWithDBTransactions\Events\AfterCommitEventAfter commit\Waska\LaravelWithDBTransactions\Events\BeforeRollbackEventBefore latest rollback\Waska\LaravelWithDBTransactions\Events\AfterRollbackEventAfter latest rollback\Waska\LaravelWithDBTransactions\Events\BeforeEveryRollbackEventBefore every rollback\Waska\LaravelWithDBTransactions\Events\AfterEveryRollbackEventAfter every rollback
Fixed composer.json
Remove unneeded version from composer.json
Initial release
waska14/laravel-with-db-transactions
Are you tired of writing database transactions for every controller method?
This package solves the problem with middleware.
Middleware begins database transaction and depending response (and config also) commits/rollbacks it.