Please I'm trying to fetch data from firebase in PHP, and it's giving me this error
Uncaught RuntimeException: Credentials fetcher does not implement Google\Auth\UpdateMetadataInterface
this is my code:
require_once 'vendor/autoload.php';
use Google\Cloud\Firestore\FirestoreClient;
$db = new FirestoreClient([
'projectId' => 'firebase-db-name'
]);
$docRef = $db->collection('collection')->document('document');
$snapshot = $docRef->snapshot();
if ($snapshot->exists()) {
printf('Document data:' . PHP_EOL);
print_r($snapshot->data());
} else {
printf('Document %s does not exist!' . PHP_EOL, $snapshot->id());
}
please what i'm i doing wrong or what do i suppose to import into the code for it to work and stop giving me the error