<?php

use Kreait\Firebase\Factory;
use Kreait\Firebase\ServiceAccount;

class FirebaseLib
{
    private $firestore;

    public function __construct()
    {
        $serviceAccount = __DIR__ . '/../config/freeme-firebase.json';


        $factory = (new Factory)->withServiceAccount($serviceAccount);
        $this->firestore = $factory->createFirestore()->database();
    }

    public function getFirestore()
    {
        return $this->firestore;
    }
}
