anourvalar / laravel-atom
ACID API
2.24.13
2026-06-22 16:32 UTC
Requires
- php: ^8.0
- laravel/framework: ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.26
- orchestra/testbench: ^9.0|^10.0|^11.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0
- squizlabs/php_codesniffer: ^3.7
This package is auto-updated.
Last update: 2026-06-22 16:33:42 UTC
README
Installation
composer require anourvalar/laravel-atom
Usage
Action after transaction commit
Atom::onCommit(function () { dispatch(new Job()); });
Action after transaction rollBack
Atom::onRollBack(function () { Storage::delete('file.jpg'); });
Pessimistic lock
Atom::lock('user');
Atom::lockUser($user->id); // equals to: Atom::lock('user', $user->id);
Optimistic lock
try { Atom::strategy('optimistic_transaction')->lock('week_report'); } catch (\AnourValar\LaravelAtom\Exceptions\OptimisticTransactionException $e) { // already in progress.. }