Laravel model returns null sometimes evenif the record exist in the database
16:19 20 Apr 2023

I have a weird issue. I have a listener runs in queue which is getting a record

Model::find($id);

But some times this is returning null even if the record exits in the database, which fails the listener in the queue. If I rerun the failed jobs after sometime, it works without any issue. I can't reproduce it, if I test it manually.

Not sure its a laravel issue or the database(MariaDB) issue!!

eloquent mariadb laravel-8 php-7.4