Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

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

LoadForge

Scalable load testing for web apps & APIs. Simulate real-world traffic and identify breaking points and performance limits with powerful, scalable load tests designed for Laravel.

LoadForge
Lucky Media logo

Lucky Media

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

Lucky Media
Tighten logo

Tighten

We help companies turn great ideas into amazing apps, products, and services.

Tighten
Laravel Cloud logo

Laravel Cloud

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

Laravel Cloud
Tinkerwell logo

Tinkerwell

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

Tinkerwell