Closed zilveer closed 5 years ago
Hi. This package if for running laravel job after transaction successfully commits and skip if transaction fails.
Usage if fairly simple
@therezor thx for your reply . What is the main difference between the built in queue in Laravel and your plugin ?
It uses the same queue class but extended to prevent adding jobs to queue before data was actually saved to DB. That make it inaccessible inside workers job
@therezor thanks, but what if the adding the job to DB fails, then we have data which has been saved to the DB?
If adding job to queue fails you'll have all your data committed to db.
@therezor then the saved data, which has relationships to the jobs is failed as well. how is it possible to reverse this or really make sure that the jobs is actually added upon DB commit ?
Hi I am using the following code
try { DB::beginTransaction(); // database queries here DB::commit(); } catch (\PDOException $e) { // Woopsy DB::rollBack(); }
In one of my controllers, how do I use this plugin so it can add the commits to the queue ? Also I suppose that I need to enable latavel queue jobs , right ?
Can you please provide a step by step guide on how to make it work with laravel and what edits I need to make on laravel to make it work ?
Bear regards