salt/firebase

Package which sets up Firebase authentication for our Laravel applications
7,592
Install
composer require salt/firebase
Latest Version:1.0.10
PHP:^8.0
Laravel:10 – 13
License:MIT
Last Updated:Oct 20, 2023
Links: GitHub  ·  Packagist
Maintainer: cwbmuller

Installation

You can install the package via composer:

composer require salt/firebase

You can publish and run the migrations with:

php artisan vendor:publish --tag="salt-firebase-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="salt-firebase-config"

This is the contents of the published config file:

<?php

return [
    'firebase' => [
        'database_url' => env('FIREBASE_DATABASE_URL', ''),
        'project_id' => env('FIREBASE_PROJECT_ID', ''),
        'private_key_id' => env('FIREBASE_PRIVATE_KEY_ID', 'your-key'),
        'private_key' => str_replace('\\n', "\n", env('FIREBASE_PRIVATE_KEY', '')),
        'client_email' => env('FIREBASE_CLIENT_EMAIL', 'e@email.com'),
        'client_id' => env('FIREBASE_CLIENT_ID', ''),
        'client_x509_cert_url' => env('FIREBASE_CLIENT_x509_CERT_URL', ''),
    ],

    // Map the route names used in this package with the application's route names
    'routes' => [
        'login' => 'login',
        'logout' => 'logout',
        'login_success' => 'index',
        'login_error' => 'error',
    ],

    // Specify allowed email domains for authentication
    // In addition to those allowed by config/auth.php
    'allowed_emails' => ['@okayemail.com'],
];

Documentation

View the documentation for this package here

Development

Install dependencies using composer install and npm install (for generating documentation).

Install the precommit using git config core.hooksPath .githooks

Testing

composer test

Code coverage

XDEBUG_MODE=coverage composer coverage

Releasing a new version

To release a new version, first create a tag on the main branch with the new version number. E.g "1.0.1":

git tag -a 1.0.1 -m "Release version 1.0.1"

Then push that tag up to GitHub:

git push origin 1.0.1

A new version will automatically be created on packagist which will then be available for installation.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

Related Packages

mpociot/laravel-firebase-sync

Synchronize your Eloquent models with a Firebase realtime database.

153,453 263
eelkevdbos/firebase-php

Firebase php wrapper for REST API

29,507 75
avto-dev/firebase-notifications-laravel

Notifications channel for Firebase service

15,462 1
salt/core

This package houses the core logic, templates and components used by Salt web ap...

7,844 0
benwilkins/laravel-fcm-notification

Laravel FCM (Firebase Cloud Messaging) Notification Channel

980,161 208

Version History

Version Released PHP License
1.0.10 ^8.0 MIT
1.0.9 ^8.0 MIT
1.0.8 ^8.0 MIT
1.0.7 ^8.0 MIT
1.0.6 ^8.0 MIT