PHP code example of anourvalar / laravel-atom

1. Go to this page and download the library: Download anourvalar/laravel-atom library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

anourvalar / laravel-atom example snippets


Atom::onCommit(function () {
    dispatch(new Job());
});

Atom::onRollBack(function () {
    Storage::delete('file.jpg');
});

Atom::lock('user');

Atom::lockUser($user->id); // equals to: Atom::lock('user', $user->id);

try {
    Atom::strategy('optimistic_transaction')->lock('week_report');
} catch (\AnourValar\LaravelAtom\Exceptions\OptimisticTransactionException $e) {
    // already in progress..
}