Laravel Phone Number Verification using Firebase Example
https://www.itsolutionstuff.com/post/laravel-phone-number-verification-using-firebase-exampleexample.html
Laravel Phone Number Verification using Firebase Example
By Hardik Savani March 13, 2021 Category : LaravelPlayUnmuteLoaded: 1.20%Fullscreen
Hello,
This article will give you example of laravel firebase phone auth. we will help you to give example of laravel mobile number verification firebase auth. i would like to show you laravel firebase mobile otp. it's simple example of firebase phone authentication laravel example. Let's get started with laravel phone number verification with firebase.
you can easily use this example with laravel 6, laravel 7, laravel 8 and laravel 9 version.
In this tutorial, i will create step by step simple example of firebase phone auth in laravel. we will create firebase app and give login with phone enable. then we will write simple code to mobile verification(opt) in laravel.
let's see bellow preview and step to complete mobile verification:
Preview:

Step 1: Create Firebase Project and App
In first step, we have to go Firebase Console and create a project. then you have to create web app on that project as like i added bellow screenshot:

After given name and next then you will received firebase sdk as like bellow screen shot:

Next you need to enable phone number auth from bellow link:

You have to save that all information because we will use in our app.
Step 2: Install Laravel
first of all we need to get fresh Laravel application using bellow command, So open your terminal OR command prompt and run bellow command:
Read Also: How to use Login Throttle in Laravel?
Step 3: Create Route
Here, we need to add one route with FirebaseController controller so let's add that route in web.php file.
routes/web.php
Step 4: Create Controller
we will create new controller as like beloow
now, so let's add like as bellow:
app/Http/Controllers/FirebaseController.php
Step 5: Create Blade File
let's create new blade file that where we write all logic on phone auth.
resources/views/firebase.blade.php
Ok, now we are ready to run.
So let's run project using this command:
Read Also: Laravel Razorpay Payment Gateway Example
I hope it can help you...
Last updated
Was this helpful?