Skip to content

thanhctES/firebase-php

 
 

Repository files navigation

Firebase Admin SDK for PHP

Interact with Google Firebase from your PHP application.

Current version Supported PHP version Build Status GitHub license Total Downloads Maintainability Test Coverage

Quickstart

Full documentation at firebase-php.readthedocs.io.

composer require kreait/firebase-php ^3.0
<?php

require __DIR__.'/vendor/autoload.php';

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

$serviceAccount = ServiceAccount::fromJsonFile(__DIR__.'/google-service-account.json');

$firebase = (new Factory)
    ->withServiceAccount($serviceAccount)
    ->withDatabaseUri('https://my-project.firebaseio.com')
    ->create();

$database = $firebase->getDatabase();

$newPost = $database
    ->getReference('blog/posts')
    ->push([
        'title' => 'Post title',
        'body' => 'Post body'
    ]);

$newPost->getChild('title')->set('Changed post title');

$newPost->remove();

For errors and missing features, please use the issue tracker.

For general support, join the #php channel at https://firebase.community/.

About

Firebase Admin SDK for PHP

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.3%
  • Makefile 0.7%