PHP code example of salt / firebase

1. Go to this page and download the library: Download salt/firebase library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

salt / firebase example snippets




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', '[email protected]'),
        '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'],
];

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