PHPackages                             tungltdev/laravel-firebase-sync - 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. tungltdev/laravel-firebase-sync

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

tungltdev/laravel-firebase-sync
===============================

Synchronize your Eloquent models with a Firebase realtime database.

0.0.1(6y ago)011MITPHPPHP &gt;=5.4.0

Since Sep 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/tungltdev/laravel-firebase-sync)[ Packagist](https://packagist.org/packages/tungltdev/laravel-firebase-sync)[ Docs](http://github.com/tungltdev/laravel-firebase-sync)[ RSS](/packages/tungltdev-laravel-firebase-sync/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Laravel Firebase Sync
=====================

[](#laravel-firebase-sync)

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/a15e383d344614203f664d52e9b05cf8cae52cbaf92550193e3960c100e06922/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74756e676c746465762f6c61726176656c2d66697265626173652d73796e632e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/a15e383d344614203f664d52e9b05cf8cae52cbaf92550193e3960c100e06922/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74756e676c746465762f6c61726176656c2d66697265626173652d73796e632e7376673f7374796c653d666c6174)[![image](https://camo.githubusercontent.com/7731e1f0bd3438ea98db701cd80a99e5045bff13bd91e179742bc12b4504b540/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f74756e676c746465762f6c61726176656c2d66697265626173652d73796e632e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/7731e1f0bd3438ea98db701cd80a99e5045bff13bd91e179742bc12b4504b540/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f74756e676c746465762f6c61726176656c2d66697265626173652d73796e632e7376673f7374796c653d666c6174)[![codecov.io](https://camo.githubusercontent.com/6c71a4512d71ae42dd6f2a664d62b71c5fd269485fd66bbf78a2352514ffde7e/68747470733a2f2f636f6465636f762e696f2f6769746875622f74756e676c746465762f6c61726176656c2d66697265626173652d73796e632f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/tungltdev/laravel-firebase-sync?branch=master)[![Build Status](https://camo.githubusercontent.com/c54575d0461504881e649028476c12951bccda0319d7385b592ea583e1ab3c10/68747470733a2f2f7472617669732d63692e6f72672f74756e676c746465762f6c61726176656c2d66697265626173652d73796e632e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tungltdev/laravel-firebase-sync)

Contents
--------

[](#contents)

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

\## Installation In order to add Laravel Firebase Sync to your project, just add

```
"tungltdev/laravel-firebase-sync": "~1.0"

```

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

Or run `composer require tungltdev/laravel-firebase-sync ` if you prefer that.

\## Usage ### Configuration

[](#configuration)

This package requires you to add the following section to your `config/services.php` file:

```
'firebase' => [
    'api_key' => 'API_KEY', // Only used for JS integration
    'auth_domain' => 'AUTH_DOMAIN', // Only used for JS integration
    'database_url' => 'https://your-database-at.firebaseio.com',
    'secret' => 'DATABASE_SECRET',
    'storage_bucket' => 'STORAGE_BUCKET', // Only used for JS integration
]
```

**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 `Tungltdev\Firebase\SyncsWithFirebase` trait.

```
use Tungltdev\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`.

### Synchronizing models not sync on event

[](#synchronizing-models-not-sync-on-event)

If you want to disable synchronization, you can use the attribute $withoutSyncsWithFirebase

```
use Tungltdev\Firebase\SyncsWithFirebase;

class User extends Model {

    use SyncsWithFirebase;
    protected $withoutSyncsWithFirebase=['created','updated','deleted'];
}
```

```
'created' : off sync on create model
'updated' : off sync on update model
'deleted' : off sync on delete model

```

\## License Laravel Firebase Sync is free software distributed under the terms of the MIT license.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

2436d ago

### Community

Maintainers

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

---

Top Contributors

[![lethanhtung97](https://avatars.githubusercontent.com/u/42159471?v=4)](https://github.com/lethanhtung97 "lethanhtung97 (1 commits)")[![tungltdev](https://avatars.githubusercontent.com/u/31556693?v=4)](https://github.com/tungltdev "tungltdev (1 commits)")

---

Tags

laraveleloquentfirebase

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tungltdev-laravel-firebase-sync/health.svg)

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

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[mpociot/laravel-firebase-sync

Synchronize your Eloquent models with a Firebase realtime database.

267152.9k1](/packages/mpociot-laravel-firebase-sync)[cybercog/laravel-love

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

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

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