Reputation: 99
I relatively new on using firebase on laravel and currently encountering an error in postman "Error: read ECONNRESET" everytime I run createUser what could be the problem?
public function __construct()
{
$this->auth = Firebase::auth();
$this->firestore = Firebase::firestore();
}
public function createUser($registrant)
{
//this works
$user = $this->auth->createUserWithEmailAndPassword($registrant['email'], $registrant['password']);
$userColl = $this->firestore->database()->collection('users')->document('test');
// returning ECONNRESET
$userRef = $userColl->set([
$registrant
]);
}
Upvotes: 0
Views: 27
Reputation: 69
The ECONNRESET error in Postman when working with Laravel and Firestore basically indicates that the connection was reset during the communication process. This often happens when the server abruptly closes the connection before the response is complete.
Here is a solution that may work.
Verify that your firebase.json file contains the correct credentials. Ensure your Firebase project is properly set up and has Firestore enabled.
Check that the $collection and $documentId variables are defined correctly.
In Postman, increase the request timeout settings. Also in your Laravel app, consider increasing PHP script execution time
Upvotes: 0