### Install Firebase for Laravel Source: https://github.com/kreait/laravel-firebase/blob/main/README.md Installs the Firebase for Laravel package using Composer. ```bash composer require kreait/laravel-firebase ``` -------------------------------- ### Publish Firebase Configuration Source: https://github.com/kreait/laravel-firebase/blob/main/README.md Publishes the Firebase configuration file to the Laravel config directory. ```bash php artisan vendor:publish --provider="Kreait\Laravel\Firebase\ServiceProvider" --tag=config ``` -------------------------------- ### Accessing Firebase Components for Specific Projects Source: https://github.com/kreait/laravel-firebase/blob/main/README.md Demonstrates how to retrieve instances of Firebase components (like Auth) for the default project and explicitly for named projects using the Firebase facade. ```php use Kreait\Laravel\Firebase\Facades\Firebase; // Return an instance of the Auth component for the default Firebase project $defaultAuth = Firebase::auth(); // Return an instance of the Auth component for a specific Firebase project $appAuth = Firebase::project('app')->auth(); $anotherAppAuth = Firebase::project('another-app')->auth(); ``` -------------------------------- ### Firebase Credentials with JSON File Source: https://github.com/kreait/laravel-firebase/blob/main/README.md Configures Firebase credentials by specifying the path to the service account JSON file in the .env file. ```env FIREBASE_CREDENTIALS=storage/app/firebase-auth.json ``` -------------------------------- ### Configure Firebase Database URL Source: https://github.com/kreait/laravel-firebase/blob/main/README.md Sets the Firebase database URL in the .env file for package configuration. ```env FIREBASE_DATABASE_URL=https://.firebaseio.com ``` -------------------------------- ### Firebase Credentials with Array Configuration Source: https://github.com/kreait/laravel-firebase/blob/main/README.md Provides Firebase service account credentials as an array in the Laravel configuration file. ```php 'credentials' => [ 'type' => 'service_account', 'project_id' => 'some-project-123', 'private_key_id' => '123456789', 'private_key' => '-----BEGIN PRIVATE KEY-----\nFOO_BAR_123456789\n-----END PRIVATE KEY-----\n', 'client_email' => 'firebase-adminsdk-cwiuo@some-project-123.iam.gserviceaccount.com', 'client_id' => '123456789', 'auth_uri' => 'https://accounts.google.com/o/oauth2/auth', 'token_uri' => 'https://oauth2.googleapis.com/token', 'auth_provider_x509_cert_url' => 'https://www.googleapis.com/oauth2/v1/certs', 'client_x509_cert_url' => 'https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-cwiuo%40some-project-123.iam.gserviceaccount.com', 'universe_domain' => 'googleapis.com', ], ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.