Support the ongoing development of Laravel.io →
posted 1 week ago
Laravel
0
moderator

Hello @nazreen-cod

Can you show what you have tried? That can help people to answer your question :)

0

hi @tvbeek

I'm trying to connect a Laravel web application to Firebase, but I've run into difficulties. Specifically, I followed a tutorial and installed the necessary package (kreait/laravel-firebase), but I’m unable to establish a connection.

Steps I’ve Taken: 1.Created a new Laravel project:laravel new fyp_firebase

2.Installed the kreait/laravel-firebase package:composer require kreait/laravel-firebase

3.Downloaded the Firebase Service Account JSON key from the Firebase Console (Settings → Service Accounts → Generate New Private Key).

4.Configured the .env file to add Firebase credentials:FIREBASE_CREDENTIALS=/path/to/firebase-service-account.json

5.Published the Firebase configuration to configure the package: php artisan vendor:publish --provider="Kreait\Laravel\Firebase\ServiceProvider"

6.Configured config/firebase.php: The Firebase config file was automatically generated, and I updated it to include the correct path to the Firebase service account key:

return [
    'credentials' => env('FIREBASE_CREDENTIALS'),
    // other settings like database URL
];
Last updated by @nazreen-cod 1 week ago.

xuliangshao, phil-reck liked this reply

2

Sign in to participate in this thread!

Eventy

Your banner here too?

nazreen nazreen-cod Joined 12 Dec 2024

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.