Get expert guidance in a few days with a Laravel code review

Laravel Firebase

kreait/laravel-firebase image

Laravel Firebase stats

Downloads
5.1M
Stars
862
Open Issues
3
Forks
144

View on GitHub →

A Laravel package for the Firebase PHP Admin SDK

Firebase for Laravel

This Laravel package integrates your application with Firebase using the Firebase PHP Admin SDK, allowing seamless interaction with Firebase services directly from your Laravel projects.

Key Features

  • Ease of Installation: Simply use Composer to get started with composer require kreait/laravel-firebase.
  • Automatic Configuration: Leverages environment variables and Google's known paths for hassle-free setup of service accounts.
  • Support for Multiple Projects: Easily manage multiple Firebase projects within the same Laravel application.
  • Streamlined Usage: Utilizes Laravel's Service Providers, avoiding the need for manual SDK bootstrapping. Supports Dependency Injection and Facades for straightforward code.
  • Active Support: Regular updates and security patches, with detailed version support aligned with Laravel's releases.

Installation and Configuration

Install the package via Composer:

composer require kreait/laravel-firebase

For authentication, set up a Firebase Service Account by downloading the JSON file and configuring the FIREBASE_DATABASE_URL in your .env file:

FIREBASE_DATABASE_URL=https://<your-project>.firebaseio.com

Further customize settings by publishing the config file to your Laravel config directory:

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

Usage

Access Firebase components using the Laravel facade without needing to instantiate new Factory objects:

use Kreait\Laravel\Firebase\Facades\Firebase;
 
$defaultAuth = Firebase::auth(); // Default Firebase project
$appAuth = Firebase::project('app')->auth(); // Specific Firebase project

Refer to the Firebase PHP Admin SDK documentation for more detailed usage instructions.

Supported Versions

This package only actively supports the latest version (5.x as of now), which is compatible with Laravel ^9.0. Older versions receive only security updates. Check the SDK’s README for a detailed look at supported versions across different Laravel releases.

This package is ideal for developers looking to leverage Firebase within their Laravel applications efficiently, with minimal setup and robust support for various Firebase functionalities.

kreait photo

… is now elvah

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Kreait Laravel Firebase Related Articles

Send Notifications in Laravel with Firebase Cloud Messaging and Notifire image

Send Notifications in Laravel with Firebase Cloud Messaging and Notifire

Read article
Firebase Cloud Notifications for Laravel image

Firebase Cloud Notifications for Laravel

Read article
Firebase Cloud Messaging for Laravel image

Firebase Cloud Messaging for Laravel

Read article
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit