We will look at a couple of common scenarios where adding a couple of lines to your tests can future-proof your application from data loss when using Model Observers.
PHP
Laravel Deadlocks: Queue Jobs That Already Ran End Up in failed_jobs
Below MySQL 8.0.1, or on a server Laravel misreads, workers reserve jobs with a plain FOR UPDATE and can deadlock on the DELETE. One tinker line shows which lock yours use. Read more