1 / 1
Mar 14

Hi there. I’m trying to connect with a mongodb hosted on atlas in a Laravel v12 application. I have the db config all setup correctly, I have the models wired up correctly, I am using v5.2 of the mongodb/laravel-mongodb package installed, and I have v1.21 of the php extension installed:

php --ri mongodb mongodb MongoDB support => enabled MongoDB extension version => 1.21.0 MongoDB extension stability => stable libbson bundled version => 1.30.1 libmongoc bundled version => 1.30.1 libmongoc SSL => enabled libmongoc SSL library => OpenSSL libmongoc crypto => enabled libmongoc crypto library => libcrypto libmongoc crypto system profile => disabled libmongoc SASL => enabled libmongoc SRV => enabled libmongoc compression => enabled libmongoc compression snappy => enabled libmongoc compression zlib => enabled libmongoc compression zstd => enabled libmongocrypt bundled version => 1.12.0 libmongocrypt crypto => enabled libmongocrypt crypto library => libcrypto crypt_shared library version => unknown Directive => Local Value => Master Value mongodb.debug => no value => no value

but when I try to do something simple like Model::first() all I get back is NULL, even though the model’s collection is not empty.

What’s the best approach to trying to track down the issue here?

Thanks!