Try Depot: Bring ultra-fast, remote Docker builds directly to your Laravel workflow

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


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
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

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

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

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Shift logo

Shift

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

Shift
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum