Creating the API endpoints with Laravel
The first step to create our chat app is to create a backend app with Laravel. Creating the API with Laravel is the main thing that we have to learn for this chapter. This is something that we have not done before. It also means that we have to write code in PHP since Laravel is a PHP-based web framework. Therefore, you should learn some basic PHP syntaxes before reading this code. Like JavaScript and other object-oriented languages, they share similar concepts such as using objects, arrays, dictionaries, loops, classes, and other basic object-oriented programming concepts. Therefore, it should not be too different from JavaScript in terms of difficulty of learning.
Installing the required libraries
To create our API with Laravel, we don't have to create all the files ourselves, we just have to run a few commands and that will create all the files and configuration settings for us automatically. Before we create our API, we have to...