A demo Laravel app to demonstrate the dangers of using firstOrCreate in a queued environment
Read this blogpost on murze.be first to get familiar with the problem.
To run this demo you'll need to have Redis installed
- Clone the repo
- Install the dependencies with
- Create a
php artisan key:generate
php artisan migrate
- In a seperate terminal start Horizon with
php artisan horizon
php artisan create-products
If you look in the
products table of the database multiple records with the same uuid will have been created.