PHPackages                             jaredchu/jc-firebase-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jaredchu/jc-firebase-php

AbandonedArchivedLibrary[API Development](/categories/api)

jaredchu/jc-firebase-php
========================

Firebase PHP RESTful library

v1.2.1(6y ago)151.1k5MITPHPPHP &gt;=5.5

Since Dec 1Pushed 6y ago1 watchersCompare

[ Source](https://github.com/jaredchu/JC-Firebase-PHP)[ Packagist](https://packagist.org/packages/jaredchu/jc-firebase-php)[ RSS](/packages/jaredchu-jc-firebase-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (16)Used By (0)

[![](https://camo.githubusercontent.com/021a0426ea3fdbda072363ed28393029b8720983acafad34e327ac4c4a86191c/687474703a2f2f692e696d6775722e636f6d2f43545039446d752e6a7067)](https://camo.githubusercontent.com/021a0426ea3fdbda072363ed28393029b8720983acafad34e327ac4c4a86191c/687474703a2f2f692e696d6775722e636f6d2f43545039446d752e6a7067)

PHP library access Firebase RESTful API
=======================================

[](#php-library-access-firebase-restful-api)

[![Packagist](https://camo.githubusercontent.com/73e24724a195d20bb93339ffed324c787ee2d12777b7a8639f17c63a3be0d6b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a617265646368752f4a432d46697265626173652d5048502e737667)](https://packagist.org/packages/jaredchu/jc-firebase-php)[![Packagist](https://camo.githubusercontent.com/4b0bd954ccd705a886e32b616924f8c28d298d5be75e65e540338598f633f003/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a617265646368752f4a432d46697265626173652d5048502e737667)](https://packagist.org/packages/jaredchu/jc-firebase-php)[![Travis](https://camo.githubusercontent.com/87a723c440ffa48bb6e02565b6b7a43d07fca62442f6ac4fe3fa9085e1b1a591/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6a617265646368752f4a432d46697265626173652d5048502e737667)](https://travis-ci.org/jaredchu/JC-Firebase-PHP)[![Scrutinizer](https://camo.githubusercontent.com/4953f0e118284d6e8a67e85745e314461e9d618c6a0847551cd029fc269033e4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6a617265646368752f4a432d46697265626173652d5048502e737667)](https://scrutinizer-ci.com/g/jaredchu/JC-Firebase-PHP/)[![Codecov](https://camo.githubusercontent.com/f6e566dd609a0d7f43be8fc26dd2bf747bd647d53d8b34fac491357cbcd2b8d1/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6a617265646368752f4a432d46697265626173652d5048502e737667)](https://codecov.io/gh/jaredchu/JC-Firebase-PHP)[![Packagist](https://camo.githubusercontent.com/27aae7c4e82041c3b64000b8653ec3f519ff99e7011255dfcf6e5b85ec7ffe25/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a617265646368752f4a432d46697265626173652d5048502e737667)](https://packagist.org/packages/jaredchu/jc-firebase-php)[![FOSSA Status](https://camo.githubusercontent.com/72220626646816d86a08e5e330b15dff3f1a733f79f8c59f3c15eddfb71a33a8/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f67697425324268747470732533412532462532466769746875622e636f6d2532466a617265646368752532464a432d46697265626173652d5048502e7376673f747970653d736869656c64)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fjaredchu%2FJC-Firebase-PHP?ref=badge_shield)

Installation
------------

[](#installation)

`$ composer require jaredchu/jc-firebase-php`

Usage
-----

[](#usage)

Generate a [private key in JSON format](https://cloud.google.com/storage/docs/authentication#service_accounts). [![](https://camo.githubusercontent.com/3e97bb003c8cd2f34fdef641a2a781dd5335b2c0504a2c88040c5f87879190dd/687474703a2f2f692e696d6775722e636f6d2f4d5135574842462e706e67)](https://camo.githubusercontent.com/3e97bb003c8cd2f34fdef641a2a781dd5335b2c0504a2c88040c5f87879190dd/687474703a2f2f692e696d6775722e636f6d2f4d5135574842462e706e67)

#### Check Firebase credential

[](#check-firebase-credential)

```
use JC\Firebase\JCFirebase;

$firebaseURI = "https://.firebaseio.com";
$jsonKeyFile = "path/to/serviceAccountKey.json";

$firebase = new JCFirebase::fromKeyFile( $firebaseURI, $jsonKeyFile );
if( $firebase->isValid() ){
    //do something
}
```

#### GET - Reading Data

[](#get---reading-data)

```
$response = $firebase->get('user');
echo $response->success;
echo $response->body;
```

#### PUT - Writing Data

[](#put---writing-data)

```
$response = $firebase->put('user', array('data' => array('first_name'=>'Jared','last_name'=>'Chu')));
echo $response->status_code;
echo $response->body;
```

#### POST - Pushing Data

[](#post---pushing-data)

```
$response = $firebase->post('log', array('data' => array('code'=>401,'message'=>'Not Authorized')));
echo $response->status_code;
echo $response->body;
```

#### PATCH - Updating Data

[](#patch---updating-data)

```
$response = $firebase->patch('user', array('data' => array('first_name'=>'Jared',
                             'last_name'=>'Leto','age'=>27)));
echo $response->status_code;
echo $response->body;
```

#### DELETE - Removing Data

[](#delete---removing-data)

```
$response = $firebase->delete('user/first_name');
echo $response->status_code;
echo $response->body;
```

Modeling
--------

[](#modeling)

#### Create Firebase connector

[](#create-firebase-connector)

```
use JC\Firebase\JCFirebase;

$firebaseURI = "https://.firebaseio.com";
$jsonKeyFile = "path/to/serviceAccountKey.json";

$firebase = new JCFirebase::fromKeyFile( $firebaseURI, $jsonKeyFile );
```

#### Extend your Model with FirebaseModel

[](#extend-your-model-with-firebasemodel)

```
class Log extends FirebaseModel {
	/**
	 * @var integer
	 */
	public $code;
	/**
	 * @var string
	 */
	public $message;
}
```

#### Get record

[](#get-record)

```
$log = Log::findByKey( $key, $firebase );
echo $log->key;
echo $log->code;
echo $log->message;

$logs = Log::findAll( $firebase );
foreach ($logs as $log){
    echo $log->key;
    echo $log->code;
    echo $log->message;
}
```

#### Create record

[](#create-record)

```
$log          = new Log( $firebase );
$log->code    = 200;
$log->message = 'Success';
$log->save();
```

#### Update record

[](#update-record)

```
$log = Log::findByKey( $key, $firebase );
$log->code    = 400;
$log->message = 'Bad Request';
$log->save();
```

#### Delete record

[](#delete-record)

```
$log = Log::findByKey( $key, $firebase );
$log->delete();
```

Contributing
------------

[](#contributing)

1. Fork it!
2. Create your feature branch: `$ git checkout -b feature/your-new-feature`
3. Commit your changes: `$ git commit -am 'Add some feature'`
4. Push to the branch: `$ git push origin feature/your-new-feature`
5. Submit a pull request.

License
-------

[](#license)

[MIT License](https://github.com/jaredchu/JC-Firebase-PHP/blob/master/LICENSE)

[![FOSSA Status](https://camo.githubusercontent.com/74d036db342741eafe7656fe05913b4ace4bd8a080d2be357ba2df8de407a02d/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f67697425324268747470732533412532462532466769746875622e636f6d2532466a617265646368752532464a432d46697265626173652d5048502e7376673f747970653d6c61726765)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fjaredchu%2FJC-Firebase-PHP?ref=badge_large)

Support on Beerpay
------------------

[](#support-on-beerpay)

Hey dude! Help me out for a couple of 🍻!

[![Beerpay](https://camo.githubusercontent.com/abc7cd934c20a12407e6e2bff453adac2047c76377df016d354c577b1e5a1995/68747470733a2f2f626565727061792e696f2f6a617265646368752f4a432d46697265626173652d5048502f62616467652e7376673f7374796c653d626565722d737175617265)](https://beerpay.io/jaredchu/JC-Firebase-PHP) [![Beerpay](https://camo.githubusercontent.com/df02e366f27eb558cf26f7bffe7ee8428906a3ef63aba514c68cfad9d031a4c6/68747470733a2f2f626565727061792e696f2f6a617265646368752f4a432d46697265626173652d5048502f6d616b652d776973682e7376673f7374796c653d666c61742d737175617265)](https://beerpay.io/jaredchu/JC-Firebase-PHP?focus=wish)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 98.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~83 days

Recently: every ~231 days

Total

15

Last Release

2275d ago

Major Versions

v0.2-alpha → v1.02016-12-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/a69c2bf415fcf22844ab18f8a9cb816ac5e02a3f3ea0f345c3fc9934be11615a?d=identicon)[jaredchu](/maintainers/jaredchu)

---

Top Contributors

[![jaredchu](https://avatars.githubusercontent.com/u/4394552?v=4)](https://github.com/jaredchu "jaredchu (88 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")

---

Tags

firebasepackagistphpphp-libraryphp7scrutinizerfirebaserestful

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jaredchu-jc-firebase-php/health.svg)

```
[![Health](https://phpackages.com/badges/jaredchu-jc-firebase-php/health.svg)](https://phpackages.com/packages/jaredchu-jc-firebase-php)
```

###  Alternatives

[api-ecosystem-for-laravel/dingo-api

A RESTful API package for the Laravel and Lumen frameworks.

3121.5M10](/packages/api-ecosystem-for-laravel-dingo-api)[light/yii2-swagger

swagger intergation with yii2

154801.6k4](/packages/light-yii2-swagger)[slince/shopify-api-php

Shopify API Client for PHP

131236.9k1](/packages/slince-shopify-api-php)[phpexperts/simple-dto

A quick and easy DTO package.

521.1M7](/packages/phpexperts-simple-dto)[nezamy/route

Route - Fast, flexible routing for PHP, enabling you to quickly and easily build RESTful web applications.

21436.6k5](/packages/nezamy-route)[obiefy/api-response

Simple Laravel package to return Json responses.

17324.6k](/packages/obiefy-api-response)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
