In this tutorial, you will learn how to create a RESTful CRUD (Create, Read, Update, and Delete) API with Laravel that stores its data in a Firebase realtime database.
What is Firebase?
Google Firebase is a Google-backed application development platform that enables developers to develop iOS, Android, and Web-based applications. Firebase provides tools for tracking analytics, reporting and fixing app crashes, creating marketing and product experiments, and much more.
So, without wasting time, let us dive in.
- PHP 7.4, though ideally 8.1.
- Composer installed globally.
- Prior experience with Laravel.
- A text editor such as Visual Studio Code or an IDE such as PhpStorm.
- A Google account.
Install and set up the Laravel application
To begin, you first have to install a Laravel application and run it on your local development machine.
To do that, in your terminal, run the command …
As we all know, authentication is a very important aspect of building an application because you want to ensure that users can only access routes and information that they're allowed to.
Authentication takes many forms and a common one is tokenization which we will be focusing on in this tutorial.
Tokenization replaces a sensitive data element, for example, user information such as user id's, names, and emails, with a non-sensitive substitute, known as a token.
But how will issuing tokens be beneficial to multiple authentications? Well, since every user has a unique token, and they can be stored in separate database tables, the token can be queried across these tables to find a match, and based on which return a true, the route can be limited or opened for the user.
In this tutorial, you will learn how to use multiple authentication providers in Lumen to limit access to routes, …