anourvalar / laravel-atom
ACID API
Installs: 8 821
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- laravel/framework: ^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.26
- orchestra/testbench: ^8.6
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
- psalm/plugin-laravel: ^2.8
- squizlabs/php_codesniffer: ^3.7
- dev-master
- 2.17.3
- 2.17.2
- 2.17.1
- 2.17.0
- 2.16.3
- 2.16.2
- 2.16.1
- 2.16.0
- 2.15.3
- 2.15.2
- 2.15.1
- 2.15.0
- 2.14.1
- 2.14.0
- 2.13.8
- 2.13.7
- 2.13.6
- 2.13.5
- 2.13.4
- 2.13.3
- 2.13.2
- 2.13.1
- 2.13.0
- 2.12.6
- 2.12.5
- 2.12.4
- 2.12.3
- 2.12.2
- 2.12.1
- 2.12.0
- 2.11.1
- 2.11.0
- 2.10.1
- 2.9.10
- 2.9.9
- 2.9.8
- 2.9.7
- 2.9.6
- 2.9.5
- 2.9.4
- 2.9.3
- 2.9.2
- 2.9.1
- 2.9.0
- 2.8.2
- 2.8.1
- 2.8.0
- 2.7.1
- 2.7.0
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.0
- 1.0.0
This package is auto-updated.
Last update: 2024-11-20 11:28:03 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.. }