Skip to main content

Posts

Showing posts from July, 2024

Integrate firebase database with laravel and save functionality

 How to Integrate firebase database with laravel and save functionality In this tutorial, we will use default firebase database so first login to google console and go to project settings -> service account adn click on generate new private key and download it and put it in root folder of laravel app 1) Install Google Cloud Firestore via Composer: composer require google/cloud-firestore 2) Add Firebase Credentials to .env file: Ensure you have added the following in your .env file: FIREBASE_CREDENTIALS=./firebase_credentials.json FIREBASE_PROJECT_ID=mydb 3) Create a Firestore Service Provider: You need to create a service provider to configure Firestore in your Laravel app. Run the following command to generate a service provider: php artisan make:provider FirestoreServiceProvider 4) Configure Firestore in the Service Provider: Open the newly created FirestoreServiceProvider.php file and configure Firestore: <?php namespace App\Providers; use Google\Cloud\Firestore\Fi...