How to connect Laravel to Firebase

后端 未结 1 400
無奈伤痛
無奈伤痛 2021-01-29 08:27

I am using Laravel and Firebase. I need to connect Laravel to Firebase, but I am facing this error:

Call to undefined method Kreait\\Firebase\\Factory::getDa

1条回答
  •  佛祖请我去吃肉
    2021-01-29 08:58

    Use createDatabase instead of getDatabase

    $factory = (new Firebase\Factory());
    $database  = $factory->createDatabase();
    $ref = $datebase->getReference("Posts");
    

    Read more here : firebase-php

    0 讨论(0)
提交回复
热议问题