Posts

Showing posts with the label Json Credential File

Chapter 5 - Integrate Laravel with Google Firebase connecting Cloud Firestore

Image
In this chapter, we will create a Laravel project and connect it with the Cloud Firestore with installing all necessary packages and build some basic queries. Step 1: Install a fresh Laravel Project with name my-project composer create-project --prefer-dist laravel/laravel my-project Step 2: Setup a Firebase account and Cloud Firestore Database A detail chapter on this topic is available here  https://laravelwithfirebase.blogspot.com/2020/02/chapter-3-creating-project-in-firebase-for-laravel-php.html Step 3: Use the Laravel package built over Firebase PHP Admin SDK by Kreait The package url on Github: https://github.com/kreait/laravel-firebase. We have already explain the Firebase PHP Admin SDK in previous chapters by the same Author. So this code has been used by lot of people and is highly maintainable. Run the following command to install the package. composer require kreait/laravel-firebase ...

How to add Laravel package for the Firebase PHP Admin SDK #4

Image
Learn how to add firebase admin sdk to laravel project - php. In this chapter, we will introduce you to SDK built by Kreait ( https://github.com/kreait ). Note this is not official SDK by Firebase. But the most used (1.4M downloads and 1.1K Stars) and maintainable code. Note we are going to use the Laravel - Firebase package built on above it  https://github.com/kreait/laravel-firebase  and Google Firestore PHP SDK   https://github.com/googleapis/google-cloud-php-firestore . So if you want to start building Laravel app, you can jump to related chapter but understanding base code is always necessary. So lets begin. The official document url is https://firebase-php.readthedocs.io/ and github url is  https://github.com/kreait/firebase-php . The minimum requirement of PHP for this package >= 7.0 mbstring, composer and the firebase json credential file explained in before chapters. Installation can be done in your PHP project through composer comp...

Chapter 3 - Creating a project in Firebase for Laravel PHP

Image
In this chapter, we gonna learn how to create a new Cloud Firestore database and get necessary credentials to connect with a Laravel Project. First of you have to visit the  https://firebase.google.com/  and then click on the "Go to console" on top right of page. Then sign in with your gmail ID.  Once you are in, you would see the list of your projects. One Project consists of one Cloud Firestore and one realtime Database. (We are gonna use Cloud Firestore). So lets begin by clicking on "Add Project" button.  Enter a proper name for your project. Then you can enable the google analytics for all kind of reportings. Then wait for few minutes, it will create a whole new project for you. Now click on "Continue". On the home page, you will find many options to get started. On the top left near to side bar, you will find the current project selected in the drop down of all your project. You can switch to any of your project easily. No...