PHPackages                             castro732/laravel-firebase-synchronization - 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. [Database &amp; ORM](/categories/database)
4. /
5. castro732/laravel-firebase-synchronization

ActiveLibrary[Database &amp; ORM](/categories/database)

castro732/laravel-firebase-synchronization
==========================================

Synchronize your Eloquent models with a Firebase realtime database.

2.1(8y ago)029MITPHPPHP &gt;=7.0.0

Since Jun 20Pushed 8y ago1 watchersCompare

[ Source](https://github.com/castro732/laravel-firebase-synchronization)[ Packagist](https://packagist.org/packages/castro732/laravel-firebase-synchronization)[ Docs](http://github.com/castro732/laravel-firebase-synchronization)[ RSS](/packages/castro732-laravel-firebase-synchronization/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (5)Versions (7)Used By (0)

Laravel Firebase Synchronization
================================

[](#laravel-firebase-synchronization)

Synchronize your Eloquent models with the [Firebase Realtime Database](https://firebase.google.com/docs/database/)
------------------------------------------------------------------------------------------------------------------

[](#synchronize-your-eloquent-models-with-the-firebase-realtime-database)

[![image](https://camo.githubusercontent.com/ef3ac3e8266b7a2cafb87c406b0e851a28c1828df31648db6807c4aac2d5471d/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63617374726f3733322f6c61726176656c2d66697265626173652d73796e6368726f6e697a6174696f6e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/ef3ac3e8266b7a2cafb87c406b0e851a28c1828df31648db6807c4aac2d5471d/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63617374726f3733322f6c61726176656c2d66697265626173652d73796e6368726f6e697a6174696f6e2e7376673f7374796c653d666c6174)[![image](https://camo.githubusercontent.com/d2c8f6a2b3b8c5fcc76e25822b75529a07ba47f51c238050db254aae6645fd2e/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f63617374726f3733322f6c61726176656c2d66697265626173652d73796e6368726f6e697a6174696f6e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/d2c8f6a2b3b8c5fcc76e25822b75529a07ba47f51c238050db254aae6645fd2e/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f63617374726f3733322f6c61726176656c2d66697265626173652d73796e6368726f6e697a6174696f6e2e7376673f7374796c653d666c6174)

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
- [Known issues](#knowni)
- [License](#license)

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

[](#installation)

In order to add Laravel Firebase Sync to your project, just add

```
"castro732/laravel-firebase-synchronization": "~2.0"

```

to your composer.json. Then run `composer install` or `composer update`.

Or run `composer require castro732/laravel-firebase-synchronization ` if you prefer that.

Usage
-----

[](#usage)

### Configuration

[](#configuration)

This package requires you to add the following section to your `.env` file:

```
# Firebase
FIREBASE_API_KEY="YOUR_API_KEY"
FIREBASE_DATABASE_URL="https://domain.firebaseio.com"
FIREBASE_JSON_DIR="/your-app-firebase.json"
```

You can get the json from your Firebase Console &gt; Settings &gt; Firebase Admin SDK and click Generate New Private Key.

**Note**: This package only requires the configuration keys `database_url` and `secret`. The other keys are only necessary if you want to also use the firebase JS API.

### Synchronizing models

[](#synchronizing-models)

To synchronize your Eloquent models with the Firebase realtime database, simply let the models that you want to synchronize with Firebase use the `Mpociot\Firebase\SyncsWithFirebase` trait.

```
use Castro732\Firebase\SyncsWithFirebase;

class User extends Model {

    use SyncsWithFirebase;

}
```

The data that will be synchronized is the array representation of your model. That means that you can modify the data using the existing Eloquent model attributes like `visible`, `hidden` or `appends`.

If you need more control over the data that gets synchronized with Firebase, you can override the `getFirebaseSyncData` of the `SyncsWithFirebase` trait and let it return the array data you want to send to Firebase.

Known Issues
------------

[](#known-issues)

- Tests are not working right now

License
-------

[](#license)

Laravel Firebase Sync is free software distributed under the terms of the MIT license. Based on the work of [Marcel Pociot](https://github.com/mpociot)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 52.2% 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 ~114 days

Recently: every ~12 days

Total

6

Last Release

3088d ago

Major Versions

1.0.0 → 2.02017-11-28

PHP version history (2 changes)1.0.0PHP &gt;=5.4.0

2.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1149801?v=4)[Jose](/maintainers/castro732)[@castro732](https://github.com/castro732)

---

Top Contributors

[![castro732](https://avatars.githubusercontent.com/u/1149801?v=4)](https://github.com/castro732 "castro732 (12 commits)")[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (10 commits)")[![ericvanjohnson](https://avatars.githubusercontent.com/u/89408?v=4)](https://github.com/ericvanjohnson "ericvanjohnson (1 commits)")

---

Tags

laraveleloquentfirebase

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/castro732-laravel-firebase-synchronization/health.svg)

```
[![Health](https://phpackages.com/badges/castro732-laravel-firebase-synchronization/health.svg)](https://phpackages.com/packages/castro732-laravel-firebase-synchronization)
```

###  Alternatives

[kreait/laravel-firebase

A Laravel package for the Firebase PHP Admin SDK

1.3k18.0M46](/packages/kreait-laravel-firebase)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k29.9M42](/packages/kirschbaum-development-eloquent-power-joins)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.0M88](/packages/mongodb-laravel-mongodb)[spatie/laravel-sluggable

Generate slugs when saving Eloquent models

1.5k12.4M294](/packages/spatie-laravel-sluggable)[watson/validating

Eloquent model validating trait.

9733.4M53](/packages/watson-validating)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k322.4k1](/packages/cybercog-laravel-love)

PHPackages © 2026

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