PHPackages                             grptx/yii2-firebase - 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. grptx/yii2-firebase

ActiveYii2-extension

grptx/yii2-firebase
===================

Yii2 Component to connect to Firebase Database

v0.4(7y ago)1419.9k↓100%13[1 issues](https://github.com/grptx/yii2-firebase/issues)MITPHP

Since Jul 21Pushed 7y ago2 watchersCompare

[ Source](https://github.com/grptx/yii2-firebase)[ Packagist](https://packagist.org/packages/grptx/yii2-firebase)[ RSS](/packages/grptx-yii2-firebase/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (6)Used By (0)

yii2-firebase
=============

[](#yii2-firebase)

[![Latest Stable Version](https://camo.githubusercontent.com/4c9a0778e84ae4db39fd13d76dd3e723d9c307fa2fad9174b25e4903076b181f/68747470733a2f2f706f7365722e707567782e6f72672f67727074782f796969322d66697265626173652f762f737461626c65)](https://packagist.org/packages/grptx/yii2-firebase)[![Total Downloads](https://camo.githubusercontent.com/0c969a65b45d31912c0c4159d2eecb5b7ee447b760c061d4ccab4f567a7a3bf7/68747470733a2f2f706f7365722e707567782e6f72672f67727074782f796969322d66697265626173652f646f776e6c6f616473)](https://packagist.org/packages/grptx/yii2-firebase)[![Latest Unstable Version](https://camo.githubusercontent.com/92f25e25055b1d9d0ad1bd5c0896a3004b75f640d4c8816aa7c380f0e4476d83/68747470733a2f2f706f7365722e707567782e6f72672f67727074782f796969322d66697265626173652f762f756e737461626c65)](https://packagist.org/packages/grptx/yii2-firebase)[![License](https://camo.githubusercontent.com/579dc55553149f681fdc9507f006cfb0e68c5f9aa34172709d653757c01867f9/68747470733a2f2f706f7365722e707567782e6f72672f67727074782f796969322d66697265626173652f6c6963656e7365)](https://packagist.org/packages/grptx/yii2-firebase)

This Yii2 component wraps [kreait/firebase-php](https://github.com/kreait/firebase-php/) and allow to easy connect to the Firebase realtime database

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

[](#installation)

Preferred way to install is through [Composer](https://getcomposer.org):

```
php composer.phar require grptx/yii2-firebase:~0.3.1
```

Or, you may add

```
"grptx/yii2-firebase": "~0.3.1"
```

to the require section of your `composer.json` file and execute `php composer.phar update`.

Configuration
-------------

[](#configuration)

```
...
'components' => [
    'firebase' => [
        'class'=>'grptx\Firebase\Firebase',
        'credential_file'=>'service_account.json', // (see https://firebase.google.com/docs/admin/setup#add_firebase_to_your_app)
        'database_uri'=>'https://my-project.firebaseio.com', // (optional)
    ]
...
]
```

### Optional

[](#optional)

to use the autocomplete function of IDE (i.e. Phpstorm) you can optionally replace in the web/index.php the inclusion of Yii.php file and the Application instance:

replace:

```
require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
//and
(new yii\web\Application($config))->run();
```

with:

```
require (__DIR__.'/../../vendor/grptx/yii2-firebase/src/yii2/Yii.php');
//and
(new \grptx\Firebase\web\Application($config))->run();
```

now when you need you can use grptx\\Firebase\\yii2\\Yii instead of Yii to use autocomplete of your IDE

Usage
-----

[](#usage)

Retrive a *database* ,*reference* and a *value*

```
$database = Yii::$app->firebase->getDatabase();
$reference = $database->getReference('path/to/child/location');
$value = $reference->getValue();
```

or just the *reference* and a *value*

```
$reference = Yii::$app->firebase->getReference('path/to/child/location');
$value = $reference->getValue();
```

for other method see [firebase-php.readthedocs.io.](https://firebase-php.readthedocs.io/en/latest/realtime-database.html)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Total

5

Last Release

2883d ago

### Community

Maintainers

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

---

Top Contributors

[![grptx](https://avatars.githubusercontent.com/u/6595328?v=4)](https://github.com/grptx "grptx (27 commits)")

---

Tags

firebasefirebase-databasephp7yii2yii2-componentfirebaseyii2PHP7yii2-components

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/grptx-yii2-firebase/health.svg)

```
[![Health](https://phpackages.com/badges/grptx-yii2-firebase/health.svg)](https://phpackages.com/packages/grptx-yii2-firebase)
```

PHPackages © 2026

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