thanhct/firebase-php

Firebase Admin SDK

Maintainers

πŸ‘ thanhct

Package info

github.com/thanhct/firebase-php

pkg:composer/thanhct/firebase-php

Statistics

Installs: 15

Dependents: 0

Suggesters: 0

Stars: 0

3.9.4 2018-02-03 15:17 UTC

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT aab19e7b9d399cc0aa7d393caae5444abe08d37f

databaseapigooglesdkfirebase


README

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 thanhct/firebase-php 3.9.4
<?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/.