Submit laravel jobs inside transaction. Cancel job after rollback. Proceed after successful commit.

1.1.2 2021-01-27 08:45 UTC

This package is auto-updated.

Last update: 2021-11-27 10:53:35 UTC




By using this package you easily dispatch jobs inside transactions. Cancel job on transaction rollback. Add to queue on transaction committed.


This package requires PHP 7.1 and Laravel 5.8 or higher. If you are on a PHP version below 7.1 or a Laravel version below 5.8 just use an older version of this package.

  1. Run composer require therezor/laravel-transactional-jobs in your laravel project root folder

  2. Implement TheRezor\TransactionalJobs\Contracts\RunAfterTransaction to jobs that run in the middle of database transactions


use TheRezor\TransactionalJobs\Contracts\RunAfterTransaction;

class MySuperJob implements ShouldQueue, RunAfterTransaction
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;