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

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

kreait/laravel-firebase
=======================

A Laravel package for the Firebase PHP Admin SDK

7.1.0(2mo ago)1.3k16.5M—3.3%186[1 issues](https://github.com/beste/laravel-firebase/issues)[1 PRs](https://github.com/beste/laravel-firebase/pulls)20MITPHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Aug 17Pushed 1w ago18 watchersCompare

[ Source](https://github.com/beste/laravel-firebase)[ Packagist](https://packagist.org/packages/kreait/laravel-firebase)[ GitHub Sponsors](https://github.com/sponsors/jeromegamez)[ RSS](/packages/kreait-laravel-firebase/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (16)Versions (39)Used By (20)

Firebase for Laravel
====================

[](#firebase-for-laravel)

A Laravel package for the [Firebase PHP Admin SDK](https://github.com/beste/firebase-php).

[![Current version](https://camo.githubusercontent.com/a46d8a144a065334ec363e0d4d1a1d30ae55dd54844df8b305ff70700039ced2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b72656169742f6c61726176656c2d66697265626173652e7376673f6c6f676f3d636f6d706f736572)](https://packagist.org/packages/kreait/laravel-firebase)[![Monthly Downloads](https://camo.githubusercontent.com/3a07d03496349ae51a9f5af11d756d7a7004ed18c0b2e931438cd46f65d18a3b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6b72656169742f6c61726176656c2d66697265626173652e737667)](https://packagist.org/packages/kreait/laravel-firebase/stats)[![Total Downloads](https://camo.githubusercontent.com/f2d35a240a00894054c9897ee0d980f4c81abe0eae7f6507f4dc9d71192d0217/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b72656169742f6c61726176656c2d66697265626173652e737667)](https://packagist.org/packages/kreait/laravel-firebase/stats)[![Tests](https://github.com/beste/laravel-firebase/actions/workflows/tests.yml/badge.svg)](https://github.com/beste/laravel-firebase/actions/workflows/tests.yml)[![Sponsor](https://camo.githubusercontent.com/1004a94551d1edaf2a6da4d45ba217b79a46eb18dd7dd2d7825add0a2a8ddc4f/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6f676f3d476974487562266c6162656c3d53706f6e736f72266d6573736167653d25453225394425413426636f6c6f723d666636396234)](https://github.com/sponsors/jeromegamez)

Important

**Support the project:** This library is downloaded 1M+ times monthly and powers thousands of applications. If it saves you or your team time, please consider [sponsoring its development](https://github.com/sponsors/jeromegamez).

Note

The project moved from the `kreait` to the `beste` GitHub Organization in January 2026. The namespace remains `Kreait\Laravel\Firebase` and the package name remains `kreait/laravel-firebase`. Please update your remote URL if you have forked or cloned the repository.

- [Installation](#installation)
- [Configuration](#configuration)
    - [Credentials with JSON files](#credentials-with-json-files)
    - [Credentials with Arrays](#credentials-with-arrays)
- [Usage](#usage)
    - [Multiple projects](#multiple-projects)
- [Supported Versions](#supported-versions)
- [License](#license)

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

[](#installation)

```
composer require kreait/laravel-firebase
```

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

[](#configuration)

In order to access a Firebase project and its related services using a server SDK, requests must be authenticated. For server-to-server communication this is done with a Service Account.

If you don't already have generated a Service Account, you can do so by following the instructions from the official documentation pages at [https://firebase.google.com/docs/admin/setup#initialize\_the\_sdk\_in\_non-google\_environments](https://firebase.google.com/docs/admin/setup#initialize_the_sdk_in_non-google_environments).

Once you have downloaded the Service Account JSON file, you can configure the package by specifying environment variables starting with `FIREBASE_` in your `.env` file. Usually, the following are required for the package to work:

```
# You can find the database URL for your project at
# https://console.firebase.google.com/project/_/database
FIREBASE_DATABASE_URL=https://.firebaseio.com

```

For further configuration, please see [config/firebase.php](config/firebase.php). You can modify the configuration by copying it to your local `config` directory or by defining the environment variables used in the config file:

```
# Laravel
php artisan vendor:publish --provider="Kreait\Laravel\Firebase\ServiceProvider" --tag=config
```

### Credentials with JSON files

[](#credentials-with-json-files)

The package uses auto discovery for the default project to find the credentials needed for authenticating requests to the Firebase APIs by inspecting certain environment variables and looking into Google's well known path(s).

If you don't want a service account to be auto-discovered, provide it by setting the `FIREBASE_CREDENTIALS` or `GOOGLE_APPLICATION_CREDENTIALS` environment variable or by adapting the package configuration, like so for example:

```
FIREBASE_CREDENTIALS=storage/app/firebase-auth.json
```

### Credentials with Arrays

[](#credentials-with-arrays)

If you prefer to have more control over the configuration items required to configure the credentials, you can also transpose the Service Account JSON file as an array within your `config/firebase.php` file.

```
'credentials' => [
    'type' => 'service_account',
    'project_id' => 'some-project-123',
    'private_key_id' => '123456789',
    'private_key' => '-----BEGIN PRIVATE KEY-----\nFOO_BAR_123456789\n-----END PRIVATE KEY-----\n',
    'client_email' => 'firebase-adminsdk-cwiuo@some-project-123.iam.gserviceaccount.com',
    'client_id' => '123456789',
    'auth_uri' => 'https://accounts.google.com/o/oauth2/auth',
    'token_uri' => 'https://oauth2.googleapis.com/token',
    'auth_provider_x509_cert_url' => 'https://www.googleapis.com/oauth2/v1/certs',
    'client_x509_cert_url' => 'https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-cwiuo%40some-project-123.iam.gserviceaccount.com',
    'universe_domain' => 'googleapis.com',
],
```

Usage
-----

[](#usage)

Once you have retrieved a component, please refer to the [documentation of the Firebase PHP Admin SDK](https://firebase-php.readthedocs.io)for further information on how to use it.

**You don't need and should not use the `new Factory()` pattern described in the SDK documentation, this is already done for you with the Laravel Service Provider. Use Dependency Injection, the Facades or the `app()` helper instead**

### Multiple projects

[](#multiple-projects)

Multiple projects can be configured in [config/firebase.php](config/firebase.php) by adding another section to the projects array.

When accessing components, the facade uses the default project. You can also explicitly use a project:

```
use Kreait\Laravel\Firebase\Facades\Firebase;

// Return an instance of the Auth component for the default Firebase project
$defaultAuth = Firebase::auth();
// Return an instance of the Auth component for a specific Firebase project
$appAuth = Firebase::project('app')->auth();
$anotherAppAuth = Firebase::project('another-app')->auth();
```

License
-------

[](#license)

This project is licensed under the [MIT License](LICENSE).

Your use of Firebase is governed by the [Terms of Service for Firebase Services](https://firebase.google.com/terms/).

###  Health Score

78

—

ExcellentBetter than 100% of packages

Maintenance93

Actively maintained with recent releases

Popularity73

Solid adoption and visibility

Community44

Growing community involvement

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 72.8% 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 ~65 days

Recently: every ~97 days

Total

38

Last Release

60d ago

Major Versions

2.4.0 → 3.0.02020-11-01

3.4.0 → 4.0.02022-01-09

4.2.0 → 5.0.02023-01-13

5.10.0 → 6.0.02025-02-24

6.2.0 → 7.0.02026-02-19

PHP version history (10 changes)2.2.0PHP ^7.2

2.4.0PHP ^7.2|^8.0

3.1.0PHP ^7.2|~8.0.0

4.0.0PHP ^7.4|^8.0

4.1.0PHP ^7.4 || ^8.0

5.0.0PHP ~8.1.0 || ~8.2.0

5.5.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0

5.10.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

6.0.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0

6.2.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8685cf532053a084f1eade7b7da00a512c02676e65f1f1bdec73d4978030a47d?d=identicon)[jeromegamez](/maintainers/jeromegamez)

---

Top Contributors

[![jeromegamez](https://avatars.githubusercontent.com/u/67554?v=4)](https://github.com/jeromegamez "jeromegamez (150 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (18 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (17 commits)")[![ankurk91](https://avatars.githubusercontent.com/u/6111524?v=4)](https://github.com/ankurk91 "ankurk91 (3 commits)")[![L3o-pold](https://avatars.githubusercontent.com/u/4710495?v=4)](https://github.com/L3o-pold "L3o-pold (2 commits)")[![crynobone](https://avatars.githubusercontent.com/u/172966?v=4)](https://github.com/crynobone "crynobone (1 commits)")[![dododedodonl](https://avatars.githubusercontent.com/u/100052?v=4)](https://github.com/dododedodonl "dododedodonl (1 commits)")[![gdebrauwer](https://avatars.githubusercontent.com/u/22586858?v=4)](https://github.com/gdebrauwer "gdebrauwer (1 commits)")[![clemblanco](https://avatars.githubusercontent.com/u/668419?v=4)](https://github.com/clemblanco "clemblanco (1 commits)")[![gregorip02](https://avatars.githubusercontent.com/u/62108989?v=4)](https://github.com/gregorip02 "gregorip02 (1 commits)")[![bradsk88](https://avatars.githubusercontent.com/u/2147630?v=4)](https://github.com/bradsk88 "bradsk88 (1 commits)")[![kakajansh](https://avatars.githubusercontent.com/u/7093483?v=4)](https://github.com/kakajansh "kakajansh (1 commits)")[![kevinvayro](https://avatars.githubusercontent.com/u/43274520?v=4)](https://github.com/kevinvayro "kevinvayro (1 commits)")[![l-alexandrov](https://avatars.githubusercontent.com/u/14351652?v=4)](https://github.com/l-alexandrov "l-alexandrov (1 commits)")[![marcroberts](https://avatars.githubusercontent.com/u/43874?v=4)](https://github.com/marcroberts "marcroberts (1 commits)")[![nhaynes](https://avatars.githubusercontent.com/u/3440002?v=4)](https://github.com/nhaynes "nhaynes (1 commits)")[![saeedhosan](https://avatars.githubusercontent.com/u/78552486?v=4)](https://github.com/saeedhosan "saeedhosan (1 commits)")[![sl0wik](https://avatars.githubusercontent.com/u/2696038?v=4)](https://github.com/sl0wik "sl0wik (1 commits)")[![theadeyemiolayinka](https://avatars.githubusercontent.com/u/64863320?v=4)](https://github.com/theadeyemiolayinka "theadeyemiolayinka (1 commits)")[![danikp](https://avatars.githubusercontent.com/u/3479747?v=4)](https://github.com/danikp "danikp (1 commits)")

---

Tags

firebasefirebase-authfirebase-authenticationfirebase-cloud-messagingfirebase-databasefirebase-realtime-databasefirebase-remote-configfirebase-storagelaravelphprealtime-databaseapilaravelsdkdatabasegcmfirebaseFCM

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[kreait/firebase-bundle

Symfony Bundle for the Firebase Admin SDK

1534.7M2](/packages/kreait-firebase-bundle)[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)

PHPackages © 2026

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