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) rollback
After 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\BeforeBeginTransactionEvent
Before begin transaction\Waska\LaravelWithDBTransactions\Events\AfterBeginTransactionEvent
After begin transaction\Waska\LaravelWithDBTransactions\Events\BeforeCommitEvent
Before commit\Waska\LaravelWithDBTransactions\Events\AfterCommitEvent
After commit\Waska\LaravelWithDBTransactions\Events\BeforeRollbackEvent
Before latest rollback\Waska\LaravelWithDBTransactions\Events\AfterRollbackEvent
After latest rollback\Waska\LaravelWithDBTransactions\Events\BeforeEveryRollbackEvent
Before every rollback\Waska\LaravelWithDBTransactions\Events\AfterEveryRollbackEvent
After 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.