Download the PHP package amos97/laravel-firebase without Composer
On this page you can find all versions of the php package amos97/laravel-firebase. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amos97/laravel-firebase
More information about amos97/laravel-firebase
Files in amos97/laravel-firebase
Informations about the package laravel-firebase
Laravel Firebase
Laravel Firebase integration
This package includes:
- Firebase OAuthV2.0 authentication, with token caching
- Centralized ServiceAccount credential management
- Firebase FCM Http V1 API and Firebase Realtime database REST api via OAuth authentication
- Firebase JWT token generator (via php-jwt)
- Automatic sync for Eloquent models to Firebase Realtime db
- Automatic sync triggers on related model changes
Installation
Install via composer
The package will be auto registered in laravel >=5.5; If you use laravel <5.5 follow the next two steps
-
Add service provider to
config/app.php
inproviders
section - Register package facade in
config/app.php
inaliases
section
Your file in config/laravel-firebase.php
should now look like this:
Configuration
Publish the configuration file via
Usage
JWT token
You can easly create a Firebase JWT token (for auth) with FirebaseJWT::encode
:
FCM
This package allows you to send FCM messages via FCM http v1 api
Message builder
You can easly build FCM Messages via the FCM
facade:
FCM Notification channel
You can also send the FCM messages via the FcmNotificationChannel
channel:
Real time database
Settings:
You can enable read-only access to database setting
on your .env
file, this is usefull for testing purpuses, the writes will not return any error but will not be executed on Firebase.
Query the Realtime database
To get an instance of the database use the FirebaseDb
facade:
Sync models to Firebase
see Firebase database sync